]> git.ipfire.org Git - ipfire-2.x.git/blame - src/scripts/packager
Direkt ein Fix fuer eben genannte Sachen...
[ipfire-2.x.git] / src / scripts / packager
CommitLineData
483f59cd
MT
1#!/bin/bash
2
3PROG="$1"
4VER="$2"
5PAK_VER="$3"
d535503d 6EXT=ipfire
483f59cd
MT
7
8if [ -f /install/packages/$PROG-$VER-$PAK_VER.tar.gz.empty ]; then
9
10 echo -e "Package already exists."
11
12else
13
14 # Bringing the files to their right place.
15 rm -rf /install/packages/package /tmp/* /packagetmp.tar
16 mkdir -p /install/packages/package
17 cp -f /usr/src/src/paks/$PROG/{,un}install.sh /install/packages/package
18 cp -f /usr/src/src/paks/$PROG/ROOTFILES /install/packages/package
7ccede9b 19 cp -f /usr/src/src/paks/$PROG/depends.txt /install/packages/package
483f59cd
MT
20 chmod 755 /install/packages/package/{,un}install.sh
21
22 cd / && tar --create --directory=/ --files-from=/install/packages/package/ROOTFILES --file=/packagetmp.tar --exclude='#*'
23 cd / && tar -x -C /tmp -f /packagetmp.tar
24 rm -f /packagetmp.tar
25 cd /tmp && tar --create --gzip --verbose --file=/install/packages/package/files.tgz *
26
27 cd / && rm -rf /tmp/*
28 cd /install/packages/package && cat ROOTFILES | grep -v "#" > ROOTFILES
913668ba 29 tar cfz ../$PROG-${VER}_$PAK_VER.$EXT files.tgz install.sh uninstall.sh ROOTFILES depends.txt
483f59cd 30
d535503d
MT
31 cd /install/packages && md5sum $PROG*.$EXT > $PROG-${VER}_$PAK_VER.$EXT.md5
32 cd /install/packages && md5sum $PROG*.$EXT >> all-progs.md5
483f59cd
MT
33 rm -rf /install/packages/package
34 exit 0
371d9df0 35fi