File: rules

package info (click to toggle)
joe 3.7-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,300 kB
  • ctags: 2,460
  • sloc: ansic: 34,071; sh: 3,419; makefile: 138
file content (63 lines) | stat: -rwxr-xr-x 1,879 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

tmp := $(CURDIR)/debian/joe
docdir := $(tmp)/usr/share/doc/joe

CFLAGS := -g
ifeq "$(findstring noopt,$(DEB_BUILD_OPTIONS))" ""
CFLAGS += -O2
endif

build: config.status joe

config.status: configure
	CFLAGS="$(CFLAGS)" ./configure --sysconfdir=/etc --prefix=/usr \
          --mandir='$${datadir}/man'

joe: main.c
	$(MAKE)

clean: checkroot
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -rf $(tmp) debian/*~ debian/substvars* debian/files*

install: build checkroot
	rm -rf $(tmp)
	$(MAKE) DESTDIR=$(tmp) install
ifeq "$(findstring nostrip,$(DEB_BUILD_OPTIONS))" ""
	strip --remove-section=.comment --remove-section=.note $(tmp)/usr/bin/joe
endif
	rm -f $(tmp)/usr/bin/termidx
	gzip -9 $(tmp)/usr/share/man/man1/joe.1
	gzip -9 $(tmp)/usr/share/man/ru/man1/joe.1
	for i in jmacs jstar rjoe jpico; do \
          ln -s joe.1.gz $(tmp)/usr/share/man/man1/$$i.1.gz; \
        done

binary: binary-indep binary-arch

binary-indep:

binary-arch: install
	install -m 755 -d $(tmp)/usr/share/doc/joe
	for doc in README LIST TODO NEWS; do \
          gzip -9c $$doc >$(tmp)/usr/share/doc/joe/$$doc.gz; \
        done
	rm -rf $(tmp)/etc/joe/doc
	gzip -9c debian/changelog > $(tmp)/usr/share/doc/joe/changelog.Debian.gz
	gzip -9c ChangeLog > $(tmp)/usr/share/doc/joe/changelog.gz
	install -m 644 debian/help.pl.txt $(tmp)/usr/share/doc/joe/
	install -m 644 debian/copyright debian/README.Debian $(tmp)/usr/share/doc/joe
	install -m 755 -d $(tmp)/DEBIAN
	install -m 644 debian/conffiles $(tmp)/DEBIAN
	install -m 755 debian/postinst debian/prerm debian/postrm $(tmp)/DEBIAN
	install -m 755 -d $(tmp)/usr/share/menu
	install -m 644 debian/menu $(tmp)/usr/share/menu/joe
	dpkg-shlibdeps $(tmp)/usr/bin/joe
	dpkg-gencontrol -P$(tmp) -isp
	chown -R root.root $(tmp)
	chmod -R go=rX,u+rw,a-s $(tmp)
	dpkg-deb --build $(tmp) ..

checkroot: debian/rules
	test "`id -u`" -eq "0"