#!/bin/sh # Heavily based on the Slackware 12.1 SlackBuild # http://www.gnome.org/projects/NetworkManager # Thanks to GSB script. # Packager Andrea Sciucca ( gohanz at infinito.it) # http://www.slacky.it CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package/NetworkManager NAME=NetworkManager VERSION=svn_3645 CHOST=i486 ARCH=${ARCH:-i686} BUILD=1gslacky #SOURCE=http://ftp.gnome.org/pub/GNOME/sources/NetworkManager/0.6/$NAME-$VERSION.tar.gz #if [ ! -e $NAME-$VERSION.tar.gz ]; then #wget -c $SOURCE #fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-DHEADERS_KERNEL -O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-DHEADERS_KERNEL -O3 -march=i686 -pipe -fomit-frame-pointer" elif [ "$ARCH" = "athlon64" ]; then SLKCFLAGS="-DHEADERS_KERNEL-O2 -march=athlon64 -pipe" elif [ "$ARCH" = "athlonxp" ]; then SLKCFLAGS="-DHEADERS_KERNEL -O3 -march=athlon-xp -pipe -fomit-frame-pointer" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-DHEADERS_KERNEL -O2" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-DHEADERS_KERNEL -O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi cd $TMP #tar xvzf $CWD/$NAME-$VERSION.tar.gz svn co --revision 3645 svn://svn.gnome.org/svn/NetworkManager/trunk NetworkManager echo -e "\E[0;32m+------------------------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild $NAME-$VERSION |\E[0;0m" echo -e "\E[0;32m+------------------------------------------+\E[0;0m" cd $NAME find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; chown -R root:root . ## Disable -Werror from any gcc options. ## As this is svn sources there will be warnings, but the build shouldn't fail. sed -i configure.in -e 's/-Werror//g' || exit 1 ## There is an incomplete aclocal autoconfiguration info for pilot-link. ## The autogen will fail if we don't move this out of the way first. [ -f /usr/share/aclocal/pilot-link.m4 ] && { mv -f /usr/share/aclocal/pilot-link.m4 /usr/share/aclocal/pilot-link.m4.old } CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib \ --disable-static \ --mandir=/usr/man \ --with-distro=slackware \ --with-mdns-provider=avahi \ --with-ip=/sbin/ip \ --with-dbus-sys=/etc/dbus-1/system.d \ --enable-notification-icon \ --build=$CHOST-slackware-linux echo echo "WARNING: Fixing namespaces for $VERSION" ; cp $CWD/spec-to-introspect.xsl . mkdir introspection-dirty mv -f introspection/nm-*.xml introspection-dirty for i in introspection-dirty/*.xml do xsltproc spec-to-introspect.xsl $i \ | perl -pe '$$hash = chr(35);s{xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec$${hash}extensions-v0"} {}g' \ > introspection/$(basename $i) echo "Cleaned $i for namespaces." done mkdir callouts-dirty mv -f callouts/nm-*.xml callouts-dirty for i in callouts-dirty/*.xml do xsltproc spec-to-introspect.xsl $i \ | perl -pe '$$hash = chr(35);s{xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec$${hash}extensions-v0"} {}g' \ > callouts/$(basename $i) echo "Cleaned $i for namespaces." done make make install make install DESTDIR=$PKG ## Add wpa_supplicant dbus support mkdir -p $PKG/usr/share/dbus-1/services && cp $CWD/fi.epitest.hostap.WPASupplicant.service $PKG/usr/share/dbus-1/services || exit 1 ## Restore pilot-link.m4 [ -f /usr/share/aclocal/pilot-link.m4.old ] && { mv /usr/share/aclocal/pilot-link.m4.old /usr/share/aclocal/pilot-link.m4 } ## Preserve previous settings rm $PKG/etc/rc.d/rc.networkmanager && install -m 755 $CWD/rc.networkmanager $PKG/etc/rc.d/rc.networkmanager.new || exit 1 ## Fix for Slackware non-PAM system. ## Users now can add themselves to the "netdev" group to use networkmanager. sed -i "s/at_console=\"true\"/group=\"netdev\"/g" $PKG/etc/dbus-1/system.d/NetworkManager.conf ## We use the NetworkManager tree, but we only need to build from ## within the vpn-daemons tree for the extentions. ( cd vpn-daemons ; for i in openvpn pptp vpnc ; do ( cd $i echo "*** Building $i ***" ## Configure. CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib \ --disable-static \ --mandir=/usr/man \ --with-distro=slackware \ --with-mdns-provider=avahi \ --with-ip=/sbin/ip \ --with-dbus-sys=/etc/dbus-1/system.d \ --enable-notification-icon \ --build=$CHOST-slackware-linux ## Build and install. make && make DESTDIR=$PKG install || exit 1 ## Fix missing automake stuff for i in $PKG/etc/NetworkManager/VPN/*.name ; do sed -i "s:@PREFIX@:/usr:g" $i; sed -i "s:\${LIB}:lib:g" $i; done; ) done; ) mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a \ AUTHORS CONTRIBUTING COPYING ChangeLog INSTALL NEWS README TODO \ $PKG/usr/doc/$NAME-$VERSION ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild echo "if [ -x /usr/bin/scrollkeeper-update ]; then /usr/bin/scrollkeeper-update -p /var/lib/scrollkeeper 1> /dev/null 2> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh echo "if [ -x /usr/bin/update-mime-database ]; then /usr/bin/update-mime-database /usr/share/mime &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh echo "if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database 1> /dev/null 2> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh echo "if [ -x /usr/bin/gtk-update-icon-cache ]; then /usr/bin/gtk-update-icon-cache -f -q /usr/share/icons/hicolor 1> /dev/null 2> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh gzip -9 $PKG/usr/man/*/* cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/networkmanager-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi