File: Makefile

package info (click to toggle)
alien 6.18
  • links: PTS
  • area: main
  • in suites: slink
  • size: 256 kB
  • ctags: 61
  • sloc: perl: 923; makefile: 118
file content (68 lines) | stat: -rw-r--r-- 2,301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
all:

clean:
	-rm build
	-rm *.bak

install:	
	install -d $(DESTDIR)/usr/bin
	install alien $(DESTDIR)/usr/bin
	install -d $(DESTDIR)/usr/lib/alien $(DESTDIR)/var/lib/alien
	cp -fa lib/* $(DESTDIR)/usr/lib/alien
	cp -f patches/* $(DESTDIR)/var/lib/alien
	-rm -f $(DESTDIR)/var/lib/alien/*.gz
	gzip -qf9 $(DESTDIR)/var/lib/alien/*
	install -d $(DESTDIR)/usr/man/man1
	cp -f alien.1 $(DESTDIR)/usr/man/man1

# This updates the version number in various files.
VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
VERFILES=alien.spec alien.lsm
OLD_VER=$(shell perl -e '<>;<>;while(length(<>)>1){};<>;<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
version:
	echo Updating version info....
	perl -i -pe "s/\@version\@/$(VER)/g" <alien.spec.in >alien.spec
	perl -i -pe "s/\@version\@/$(VER)/g" <alien.lsm.in >alien.lsm

localdist:
# Install in the proper location on my ftp server and web server. Not intended
# for use by anyone except the author.
	if [ `hostname` = 'kite' ] ; then \
		cp ../alien_$(VER).tar.gz ../../public; \
		rm /home/ftp/pub/code/alien/* || true; \
		cp *.lsm /home/ftp/pub/code/alien; \
		cp CHANGES /home/pub/programs/alien/CHANGES; \
		echo $(VER) > /home/pub/programs/alien/LATEST-VERSION-IS; \
		cd ..; rm -rf alien-$(OLD_VER); \
		[ -f ../public/alien_$(OLD_VER).tar.gz ] && \
		tar zxf ../public/alien_$(OLD_VER).tar.gz || \
		tar zxf ../outdated/alien_$(OLD_VER).tar.gz; \
		diff -r -u --new-file --exclude alien.lsm \
			--exclude alien.spec --exclude CHANGES \
			alien-$(OLD_VER) alien-$(VER) > \
			/home/ftp/pub/code/alien/diffs/alien-$(VER).diff; \
		gzip -9f /home/ftp/pub/code/alien/diffs/alien-$(VER).diff; \
		cd /home/ftp/pub/code/alien; \
		ln -sf ../debian/alien_$(VER).tar.gz alien_$(VER).tar.gz; \
		ln -sf ../debian/alien_$(VER).tar.gz alien.tar.gz ; \
		cd /tmp; rm -f alien-$(OLD-VER); \
        fi

debian:
	dpkg-buildpackage -tc -rfakeroot

rpm:
	sudo rpm -ba -v alien.spec --buildarch noarch

stampede:
	if [ `hostname` = 'kite' ] ; then \
		fakeroot alien --to-slp ../alien_$(VER)_all.deb ; \
		rm -f /home/ftp/pub/code/alien/*.slp ; \
		mv alien-$(VER).slp /home/ftp/pub/code/alien/ ; \
		ln -s /home/ftp/pub/code/alien/alien-$(VER).slp \
			/home/ftp/pub/code/alien/alien.slp ; \
	fi

dist: debian localdist stampede rpm

.PHONY: debian