3 # Slackware build script for fvwm3
5 # Copyright 2020-2024, Alexander Verbovetsky, Moscow, Russia
6 # Copyright 2024, K. Eugene Carlson, Tsukuba, Japan
9 # Redistribution and use of this script, with or without modification, is
10 # permitted provided that the following conditions are met:
12 # 1. Redistributions of this script must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
16 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 cd $
(dirname $0) ; CWD
=$
(pwd)
29 VERSION
=${VERSION:-1.1.1}
32 PKGTYPE
=${PKGTYPE:-tgz}
34 if [ -z "$ARCH" ]; then
35 case "$( uname -m )" in
38 *) ARCH
=$
( uname
-m ) ;;
42 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
43 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
48 PKG
=$TMP/package-
$PRGNAM
49 OUTPUT
=${OUTPUT:-/tmp}
51 if [ "$ARCH" = "i586" ]; then
52 SLKCFLAGS
="-O2 -march=i586 -mtune=i686"
54 elif [ "$ARCH" = "i686" ]; then
55 SLKCFLAGS
="-O2 -march=i686 -mtune=i686"
57 elif [ "$ARCH" = "x86_64" ]; then
68 mkdir
-p $TMP $PKG $OUTPUT
70 rm -rf $PRGNAM-$VERSION
71 tar xvf
$CWD/$PRGNAM-$VERSION.
tar.gz
74 # rename perl libraries to avoid collisions with the stock fvwm
75 # borrowed from ALT Linux
76 # https://git.altlinux.org/gears/f/fvwm3.git?a=blob_plain;f=0001-rename-perl-fvwm.patch
77 #zcat $CWD/0001-rename-perl-fvwm.patch.gz | patch -p2
78 # fix references to renamed man pages and binaries
79 #zcat $CWD/renamed-items.patch.gz | patch -p0
83 \
( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
84 -o -perm 511 \
) -exec chmod 755 {} \
; -o \
85 \
( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
86 -o -perm 440 -o -perm 400 \
) -exec chmod 644 {} \
;
88 OSNAME
="$(awk -F= '/^ID=/{print $2}' /etc/os-release)"
92 CXXFLAGS
="$SLKCFLAGS" \
95 --libdir=/usr
/lib
${LIBDIRSUFFIX} \
97 --localstatedir=/var \
100 --docdir=/usr
/doc
/$PRGNAM-$VERSION \
104 --program-transform-name='/vwm[^3]/ s/vwm/vwm3/' \
105 --build=$ARCH-$OSNAME-linux
108 make install DESTDIR
=$PKG
110 rm -f $PKG/{,usr
/}lib
${LIBDIRSUFFIX}/*.la
112 zcat
$CWD/startfvwm3.gz
> $PKG/usr
/bin
/startfvwm3
113 chmod 755 $PKG/usr
/bin
/startfvwm3
115 mkdir
-p $PKG/etc
/X11
/xinit
116 zcat
$CWD/xinitrc.fvwm3.gz
> $PKG/etc
/X11
/xinit
/xinitrc.fvwm3
117 chmod 755 $PKG/etc
/X11
/xinit
/xinitrc.fvwm3
119 find $PKG -print0 |
xargs -0 file |
grep -e "executable" -e "shared object" |
grep ELF \
120 | cut
-f 1 -d : |
xargs strip
--strip-unneeded 2> /dev
/null || true
122 find $PKG/usr
/man
-type f
-exec gzip -9 {} \
;
123 for i
in $
( find $PKG/usr
/man
-type l
) ; do ln -s $
( readlink
$i ).gz
$i.gz
; rm $i ; done
125 mkdir
-p $PKG/usr
/doc
/$PRGNAM-$VERSION
126 cp -a CHANGELOG.md COPYING NEWS README.md
$PKG/usr
/doc
/$PRGNAM-$VERSION
127 cat $CWD/$PRGNAM.SlackBuild
> $PKG/usr
/doc
/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
129 mkdir
-p $PKG/install
130 cat $CWD/slack-desc
> $PKG/install
/slack-desc
133 /sbin
/makepkg
-l y
-c n
$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.
$PKGTYPE