Tue Nov 08, 2016 9:44 pm
#!/usr/bin/bash
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
printf "This script must be run as root"
exit 1
fi
# insert PKG and VERSION
PKG="name_of_module"
VERSION="version_of_module"
PKG_DESTDIR=/tmp/sources
PKG_BUILDIR=$PKG_DESTDIR/$PKG
SOURCE_DIR=$(pwd)
# 1) change ownership and permissions
chown -R 0:0 .
chmod -R u+w,go-w,a+rX-s .
# 2) compile
perl Makefile.PL || exit 1
INSTALLDIRS=vendor
make || exit 1
mkdir $PKG_BUILDDIR || exit 1
make DESTDIR=$PKG_BUILDIR install || exit 1
# 3) clean up and prepare
cd $PKG_BUILDIR
strip --strip-unneeded usr/bin/* usr/lib/*.so*
rm -f usr/info/dir
gzip -9N usr/info/*
gzip -9N usr/man/*/*.?
mkdir -p $PKG_DESTDIR/$PKG/usr/doc/$PKG-$VERSION
cd $SOURCE_DIR
cp -a AUTHORS COPYING README TODO FAQ /tmp/sources/$PGK_BUILDIR/usr/doc/$PKG-$VERSION
mkdir $PKG_BUILDIR/usr/description
vi $PKG_BUILDIR/usr/description/en
# 4) build the package
makepkg -l /tmp/$PKG-$VERSION-i486-1.tlz
exit 0
chown -R 0:0 .
chmod -R u+w,go-w,a+rX-s .
Makefile.PL
INSTALLDIRS=vendor
make
mkdir /tmp/sources/package-foo
make DESTDIR=$PKG install
strip --strip-unneeded usr/bin/* usr/lib/*.so*
rm -f usr/info/dir
gzip -9N usr/info/*
gzip -9N usr/man/*/*.?
mkdir -p usr/doc/foo-1.2.3
cd /directory-where-source-was-decompressed/foo-1.2.3
cp -a AUTHORS COPYING README TODO FAQ /tmp/sources/package-foo/usr/doc/foo-1.2.3
mkdir description
vi description/en
makepkg -l /tmp/foo-1.2.3-i486-1.tlz
Tue Nov 08, 2016 10:06 pm
if [ -z "$PKG" ] ; then exit
PKG="$1"
VERSION="$2"
Tue Nov 08, 2016 11:08 pm
#!/usr/bin/bash
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
printf "This script must be run as root"
exit 1
fi
----------------------------------------------
# insert PKG and VERSION
PKG=
VERSION=
if [ -z "$PKG" ] ; then printf "PKG not declared" && exit; fi
if [ -z "$VERSION" ] ; then printf "VERSION not declared" && exit; fi
PKG_BUILDIR="/tmp/sources/$PKG"
SOURCE_DIR="$(pwd)"
----------------------------------------------
# 1) change ownership and permissions
chown -R 0:0 .
chmod -R u+w,go-w,a+rX-s .
----------------------------------------------
# 2) compile
perl Makefile.PL || { echo "perl Makefile faile" && exit 1 }
INSTALLDIRS=vendor
make || {echo "make failed" && exit 1 }
mkdir "$PKG_BUILDIR" || { echo "mkdir $PKG_BUILDIR failed " && exit 1 }
make DESTDIR="$PKG_BUILDIR" install || { echo "make install failed " && exit 1 }
----------------------------------------------
# 3) clean up and prepare
cd $PKG_BUILDIR
strip --strip-unneeded usr/bin/* usr/lib/*.so*
rm -f usr/info/dir
gzip -9N usr/info/*
gzip -9N usr/man/*/*.?
mkdir -p "$PKG_BUILDIR"/usr/doc/"$PKG-$VERSION"
cd "$SOURCE_DIR"
cp -a AUTHORS COPYING README TODO FAQ /tmp/sources/"$PGK_BUILDIR"/usr/doc/"$PKG-$VERSION"
mkdir "$PKG_BUILDIR"/description
vi "$PKG_BUILDIR"/description/en
----------------------------------------------
# 4) build the package
makepkg -l /tmp/"$PKG"-"$VERSION"-i486-1.tlz
----------------------------------------------
exit 0
Wed Nov 09, 2016 1:25 am
Installing /tmp/sources/libwww-perl/usr/local/bin/lwp-request
Installing /tmp/sources/libwww-perl/usr/local/bin/lwp-dump
Appending installation info to /tmp/sources/libwww-perl/usr/local/lib/x86_64-linux-gnu/perl/5.20.2/perllocal.pod
strip: 'usr/bin/*': No such file
strip: 'usr/lib/*.so*': No such file
gzip: usr/info/*: No such file or directory
gzip: usr/man/*/*.?: No such file or directory
cp: target ‘/tmp/sources//usr/doc/libwww-perl-6.15’ is not a directory
../make_perl_modules.sh: line 50: makepkg: command not found
Wed Nov 09, 2016 2:58 am
Wed Nov 09, 2016 1:52 pm
# 2) compile
perl Makefile.PL || { echo "perl Makefile faile" ; exit 1 ; }
INSTALLDIRS=vendor
sed -i 's:/usr/local:/usr:g' Makefile
sed -i '/SITEPREFIX/s/\/local//' Makefile
make || { echo "make failed" ; exit 1 ; }
mkdir -p "$PKG_BUILDIR" || { echo "mkdir $PKG_BUILDIR failed " ; exit 1 ; }
make DESTDIR="$PKG_BUILDIR" install || { echo "make install failed " ; exit 1 ; }
#----------------------------------------------
Thu Nov 10, 2016 3:49 am