1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
29 THISAPP = core-updates
30 TARGET = $(DIR_INFO)/$(THISAPP)
32 ###############################################################################
34 ###############################################################################
44 ###############################################################################
45 # Installation Details
46 ###############################################################################
48 CORE = $(patsubst $(DIR_SRC)/config/rootfiles/%,%,$(wildcard $(DIR_SRC)/config/rootfiles/core/*))
53 rm -rf /install/packages/package
54 mkdir -p /install/packages/package
55 eval $$(cat /usr/src/config/rootfiles/$@/meta)
57 #Generate ROOTFILES from filelists
58 find $(DIR_SRC)/config/rootfiles/$@/filelists/* -maxdepth 1 | xargs cat >> /tmp/ROOTFILES.tmp
60 #remove excluded files from ROOTFILES
61 grep -f $(DIR_SRC)/config/rootfiles/$@/exclude -v /tmp/ROOTFILES.tmp > /tmp/ROOTFILES
62 rm -rf /tmp/ROOTFILES.tmp
64 #Change KVER to Kernelversion
65 sed -e "s/KVER/$(KVER)/g" -i /tmp/ROOTFILES
67 #Remove doubled files with tar/untar/tar to save space
68 tar -c -C / --files-from=/tmp/ROOTFILES \
69 -f /$(SNAME).tar --exclude='#*' --exclude='dev/pts/*' \
70 --exclude='proc/*' --exclude='tmp/ROOTFILES' \
71 --exclude-from=$(DIR_SRC)/config/rootfiles/$@/exclude
72 mv -f /tmp/ROOTFILES /install/packages/package/ROOTFILES
73 tar --preserve --numeric-owner -x -C /tmp -f /$(SNAME).tar
75 cd /tmp && tar cf /install/packages/package/files * && rm -rf *
76 cat /install/packages/package/ROOTFILES | grep -v "#" > /install/packages/package/ROOTFILES.tmp
77 rm /install/packages/package/ROOTFILES
78 mv /install/packages/package/ROOTFILES.tmp /install/packages/package/ROOTFILES
81 cp -f $(DIR_SRC)/config/rootfiles/$@/update.sh /install/packages/package
82 chmod 755 /install/packages/package/update.sh
83 cd /install/packages/package && tar cf ../core-upgrade-$(VERSION)-$$(basename $@).ipfire \
84 update.sh files ROOTFILES
85 rm -rf /install/packages/package
86 sed -e "s/NAME/core-upgrade/g" \
87 -e "s/VER/$(VERSION)/g" \
88 -e "s/RELEASE/$$(basename $@)/g" \
89 -e "s/DEPS/$(DEPS)/g" \
90 -e "s/SIZE/`ls -l \/install\/packages\/core-upgrade-$(VERSION)-$$(basename $@).ipfire | awk '{ print $$5 }'`/g" \
91 < /usr/src/src/pakfire/meta > /install/packages/meta-core-upgrade-$$(basename $@)