1
1
SRCS = src/ufw $(wildcard src/*.py)
2
2
POTFILES = locales/po/ufw.pot
5
5
EXCLUDES = --exclude='.bzr*' --exclude='*~' --exclude='*.swp' --exclude='*.pyc' --exclude='debian' --exclude='ubuntu'
6
6
VERSION = $(shell egrep '^ufw_version' ./setup.py | cut -d "'" -f 2)
7
7
SRCVER = ufw-$(VERSION)
19
19
# Use setup.py to install. See README for details
24
python3 ./setup.py install --root=$(SNAPDIR) --install-layout=deb
25
chmod 644 $(SNAPDIR)/etc/ufw/*.rules $(SNAPDIR)/etc/ufw/*.init $(SNAPDIR)/usr/share/ufw/iptables/*.rules
26
sed -i 's/IPT_MODULES=.*/IPT_MODULES=""/g' $(SNAPDIR)/etc/default/ufw
27
sed -i 's/IPT_SYSCTL=\(.*\)/IPT_SYSCTL="$$SNAP_DATA\1"/g' $(SNAPDIR)/etc/default/ufw
28
sed -i 's,net/ipv4/tcp_sack=,#net/ipv4/tcp_sack=,g' $(SNAPDIR)/etc/ufw/sysctl.conf
29
chmod -R g-w $(SNAPDIR)
31
for manfile in `ls doc/*.8` ; do \
32
page=$$(basename $$manfile); \
33
manout=$(SNAPDIR)/docs/$$(basename -s .8 $$page); \
34
echo "Creating $$page ... "; \
35
LANG='C' MANWIDTH=80 man --warnings -E ascii doc/$$page | col -b > "$$manout"; \
37
for manfile in iptables ip6tables iptables-restore ip6tables-restore ; do \
38
manout=$(SNAPDIR)/docs/$$(basename -s .8 $$manfile); \
39
echo "Creating $$manfile ... "; \
40
LANG='C' MANWIDTH=80 man --warnings -E ascii $$manfile | col -b > "$$manout"; \
42
rm -f $(SNAPDIR)/usr/lib/python3/dist-packages/ufw/__pycache__/*
43
rmdir $(SNAPDIR)/usr/lib/python3/dist-packages/ufw/__pycache__/
46
# Use setup.py to install. See README for details
50
cp -a $(SNAPDIR)/* $(DESTDIR)
51
#ln -sf /var/snap/ufw/current/usr/lib/python3/dist-packages/ufw/__pycache__ ./snappy-packaging/prime/usr/lib/python3/dist-packages/ufw/__pycache__
52
ln -sf /var/snap/ufw/current/usr/lib/python3/dist-packages/ufw/__pycache__ $(DESTDIR)/usr/lib/python3/dist-packages/ufw/__pycache__
24
54
translations: $(POTFILES)
25
55
$(POTFILES): $(SRCS)
70
100
rm -rf ./tests/testarea ./tests/unit/tmp
103
rm -rf ./parts ./stage ./prime
73
104
rm -rf ./snappy-packaging/files/* ./snappy-packaging/parts ./snappy-packaging/prime ./snappy-packaging/stage
74
105
rm -f ./snappy-packaging/*.snap
75
106
rm -f ./locales/mo/*.mo
98
129
bzr export --format dir $(TARSRC)
99
130
tar -zcv -C $(TARBALLS) $(EXCLUDES) -f $(TARDST) $(SRCVER)
105
python3 ./setup.py install --root=$(SNAPDIR) --install-layout=deb
106
chmod 644 $(SNAPDIR)/etc/ufw/*.rules $(SNAPDIR)/etc/ufw/*.init $(SNAPDIR)/usr/share/ufw/iptables/*.rules
107
sed -i 's/IPT_MODULES=.*/IPT_MODULES=""/g' $(SNAPDIR)/etc/default/ufw
108
sed -i 's/IPT_SYSCTL=\(.*\)/IPT_SYSCTL="$$SNAP_DATA\1"/g' $(SNAPDIR)/etc/default/ufw
109
sed -i 's,net/ipv4/tcp_sack=,#net/ipv4/tcp_sack=,g' $(SNAPDIR)/etc/ufw/sysctl.conf
110
chmod -R g-w $(SNAPDIR)
111
mkdir $(SNAPDIR)/docs
112
for manfile in `ls doc/*.8` ; do \
113
page=$$(basename $$manfile); \
114
manout=$(SNAPDIR)/docs/$$(basename -s .8 $$page); \
115
echo "Creating $$page ... "; \
116
LANG='C' MANWIDTH=80 man --warnings -E ascii doc/$$page | col -b > "$$manout"; \
118
for manfile in iptables ip6tables iptables-restore ip6tables-restore ; do \
119
manout=$(SNAPDIR)/docs/$$(basename -s .8 $$manfile); \
120
echo "Creating $$manfile ... "; \
121
LANG='C' MANWIDTH=80 man --warnings -E ascii $$manfile | col -b > "$$manout"; \
123
rm -f $(SNAPDIR)/usr/lib/python3/dist-packages/ufw/__pycache__/*
124
rmdir $(SNAPDIR)/usr/lib/python3/dist-packages/ufw/__pycache__/
125
cp -a $(SNAPDIR)/* ./snappy-packaging/files
126
cp -a ./snappy-packaging/bin ./snappy-packaging/files
127
cd ./snappy-packaging && snapcraft
128
ln -sf /var/snap/ufw/current/usr/lib/python3/dist-packages/ufw/__pycache__ ./snappy-packaging/prime/usr/lib/python3/dist-packages/ufw/__pycache__
129
rm -f ./snappy-packaging/*.snap
130
snapcraft snap ././snappy-packaging/prime