[c5c522c] | 1 | #!/bin/bash |
---|
| 2 | #DEP:libtermcap |
---|
| 3 | |
---|
| 4 | #######Essential package info. |
---|
| 5 | #Change these if autodetection fails. |
---|
| 6 | |
---|
| 7 | #Name of the Syn-3 package that we are going to create |
---|
| 8 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
| 9 | |
---|
| 10 | #Archive of the sourcefiles to unpack |
---|
| 11 | SRC_ARC=`ls *.tar.* *.zip 2>/dev/null` |
---|
| 12 | |
---|
| 13 | #Version of the sourcefiles |
---|
| 14 | VER=`echo $SRC_ARC| sed 's/.*-//g' | sed 's/\.tar\..*$//g' | sed 's/\.zip$//g'` |
---|
| 15 | |
---|
| 16 | #Architecture that the created binaries run on. |
---|
| 17 | #Use noarch for scripts. |
---|
| 18 | ARCH=`uname -m` |
---|
| 19 | |
---|
| 20 | #from this point on, exit on errors: |
---|
| 21 | set -e |
---|
| 22 | |
---|
| 23 | ########Build and create the pacakge. |
---|
| 24 | #Uncomment the stuff that you dont want or need |
---|
| 25 | |
---|
| 26 | #Unpack source |
---|
| 27 | #(uncomment if not needed) |
---|
| 28 | syn3_unpack $SRC_ARC |
---|
| 29 | |
---|
| 30 | #Directory where the sourcefiles are unpacked. |
---|
| 31 | #(you might have to adjust this if autodetection fails) |
---|
| 32 | SRC_DIR=`ls -c|head -1` |
---|
| 33 | |
---|
| 34 | #apply patches |
---|
| 35 | #patch -p1 -d $SRC_DIR < fluxkiosk.patch || exit 1 |
---|
| 36 | |
---|
| 37 | pushd $SRC_DIR |
---|
| 38 | |
---|
| 39 | #AUTOMAKE: Configure |
---|
| 40 | #Some usefull stuff you sometimes need to set: |
---|
| 41 | #export LDFLAGS="-L/usr/X11/lib/ -L/usr/lib/mysql/" |
---|
| 42 | #export LD_LIBRARY_PATH=/usr/lib/mysql |
---|
| 43 | #export VPATH=$LD_LIBRARY_PATH |
---|
| 44 | |
---|
| 45 | chown -R root:root . |
---|
| 46 | find . -perm 666 -exec chmod 644 {} \; |
---|
| 47 | find . -perm 664 -exec chmod 644 {} \; |
---|
| 48 | find . -perm 600 -exec chmod 644 {} \; |
---|
| 49 | find . -perm 444 -exec chmod 644 {} \; |
---|
| 50 | find . -perm 400 -exec chmod 644 {} \; |
---|
| 51 | find . -perm 440 -exec chmod 644 {} \; |
---|
| 52 | find . -perm 777 -exec chmod 755 {} \; |
---|
| 53 | find . -perm 775 -exec chmod 755 {} \; |
---|
| 54 | find . -perm 511 -exec chmod 755 {} \; |
---|
| 55 | find . -perm 711 -exec chmod 755 {} \; |
---|
| 56 | find . -perm 555 -exec chmod 755 {} \; |
---|
| 57 | |
---|
| 58 | MAKE_OPTS="" |
---|
| 59 | ./configure --prefix=/usr --without-ipv6 --without-tcpwrappers || exit 1 |
---|
| 60 | |
---|
| 61 | patch -p1 < ../get-off.patch || exit 1 |
---|
| 62 | |
---|
| 63 | #AUTOMAKE: Compile |
---|
| 64 | make $MAKE_OPTS >/dev/null || exit 1 |
---|
| 65 | |
---|
| 66 | #AUTOMAKE: Install |
---|
| 67 | mkdir -p /tmp/pkg &>/dev/null |
---|
| 68 | #make pkgconfigdir=/usr/lib/pkgconfig install_prefix=/tmp/pkg DESTDIR=/tmp/pkg INSTALL_ROOT=/tmp/pkg install_root=/tmp/pkg $MAKE_OPTS install >/dev/null || exit 1 |
---|
| 69 | PKG=/tmp/pkg |
---|
| 70 | |
---|
| 71 | cd tftp || exit 1 |
---|
| 72 | strip --strip-unneeded tftp |
---|
| 73 | mkdir -p $PKG/usr/bin |
---|
| 74 | cat tftp > $PKG/usr/bin/tftp |
---|
| 75 | chmod 755 $PKG/usr/bin/tftp |
---|
| 76 | mkdir -p $PKG/usr/man/man{1,8} |
---|
| 77 | cat tftp.1 | gzip -9c > $PKG/usr/man/man1/tftp.1.gz |
---|
| 78 | cd ../tftpd |
---|
| 79 | strip --strip-unneeded tftpd |
---|
| 80 | mkdir -p $PKG/usr/sbin |
---|
| 81 | cat tftpd > $PKG/usr/sbin/in.tftpd |
---|
| 82 | chmod 755 $PKG/usr/sbin/in.tftpd |
---|
| 83 | cat tftpd.8 | gzip -9c > $PKG/usr/man/man8/in.tftpd.8.gz |
---|
| 84 | |
---|
| 85 | #(ugly) Overwrite the Atftp manual, if its there.. else you search until you're death.... |
---|
| 86 | cp tftpd.8 $PKG/usr/man/man8/in.tftpd.8 |
---|
| 87 | |
---|
| 88 | cd .. |
---|
| 89 | mkdir -p $PKG/usr/doc/tftp_hpa-$VER |
---|
| 90 | cp -a \ |
---|
| 91 | CHANGES INSTALL INSTALL.tftp README README.security \ |
---|
| 92 | $PKG/usr/doc/tftp_hpa-$VER |
---|
| 93 | |
---|
| 94 | mkdir -p $PKG/service/tftp_hpa |
---|
| 95 | mkdir -p $PKG/home/shares/tftp |
---|
| 96 | |
---|
| 97 | mkdir -p /tmp/pkg/etc/postinst.d |
---|
| 98 | cp ../post.tftp_hpa /tmp/pkg/etc/postinst.d || exit 1 |
---|
| 99 | chmod +x /tmp/pkg/etc/postinst.d/* |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | #strip bins and other stuff |
---|
| 105 | syn3_strip /tmp/pkg || exit 1 |
---|
| 106 | |
---|
| 107 | #move development stuff and create seperate development package |
---|
| 108 | syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
| 109 | syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
| 110 | |
---|
| 111 | popd |
---|
| 112 | |
---|
| 113 | #make main package |
---|
| 114 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | |
---|