-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
98 lines (86 loc) · 3.3 KB
/
Makefile.in
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
VERSION=4.9
CC?=@CC@
INSTALL=@INSTALL@
prefix=@prefix@
CFLAGS=@CFLAGS@ @DEFS@ -Wall -I. -DVERSION=\"$(VERSION)\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPREFIX=\"$(prefix)\" @DEBUG@
LIBS=@LIBS@
mandir=@mandir@
sbindir=@sbindir@
DESTDIR=
DIRPAX=@DIRPAX@
PAX=@PAX@
HEADERS=bftpdutmp.h commands.h commands_admin.h cwd.h dirlist.h list.h login.h logging.h main.h mystring.h options.h targzip.h mypaths.h md5.h md5_loc.h
OBJS=bftpdutmp.o commands.o commands_admin.o cwd.o dirlist.o list.o login.o logging.o main.o mystring.o options.o md5.o
SRCS=bftpdutmp.c commands.c commands_admin.c cwd.c dirlist.c list.c login.c logging.c main.c mystring.c options.c md5.c
OBJS2LINK=$(OBJS) $(PAX)
all: bftpd
bftpd: $(OBJS)
./mksources $(DIRPAX)
$(CC) $(OBJS2LINK) $(LDFLAGS) $(LIBS) -o bftpd
$(OBJS): $(HEADERS) Makefile
install: all
mkdir -p $(DESTDIR)/$(prefix)/sbin
$(INSTALL) -g 0 -m 700 -o 0 bftpd $(DESTDIR)/$(prefix)/sbin
mkdir -p $(DESTDIR)/$(mandir)/man8
$(INSTALL) -g 0 -m 644 -o 0 bftpd.8 $(DESTDIR)/$(mandir)/man8
mkdir -p $(DESTDIR)/$(prefix)/etc
[ -f $(DESTDIR)/$(prefix)/etc/bftpd.conf ] || \
$(INSTALL) -g 0 -m 600 -o 0 bftpd.conf $(DESTDIR)/$(prefix)/etc
mkdir -p $(DESTDIR)/$(prefix)/var/log
touch $(DESTDIR)/$(prefix)/var/log/bftpd.log
chmod 644 $(DESTDIR)/$(prefix)/var/log/bftpd.log
mkdir -p $(DESTDIR)/$(prefix)/var/run/bftpd
chmod 755 $(DESTDIR)/$(prefix)/var/run/bftpd
clean distclean:
rm -f *~ $(OBJS) bftpd mksources.finished config.cache
[ "$(DIRPAX)" = "" ] || make -C $(DIRPAX) clean
newversion: clean
cat Makefile.in | sed -e s/$(VERSION)/$(NEWVERSION)/g > Makefile.foo
mv Makefile.foo Makefile.in
./configure --enable-pax=pax --enable-libz --enable-pam
uninstall:
rm -f $(DESTDIR)/$(prefix)/sbin/bftpd $(DESTDIR)/$(mandir)/man8/bftpd.8 \
$(DESTDIR)/$(prefix)/etc/bftpd.conf
distribute: install
rm -rf dist
mkdir dist
# Build source tarball
rm -rf bftpd-$(VERSION)
mkdir bftpd-$(VERSION)
autoconf
autoheader configure.in > config.h.in
mkdir bftpd-$(VERSION)/doc
cp CHANGELOG COPYING Makefile.in $(SRCS) $(HEADERS) \
configure.in configure config.h.in bftpd.conf install-sh mksources \
bftpd.spec.in acconfig.h bftpd.8 bftpd-$(VERSION)
cp -r doc bftpd-$(VERSION)
cd bftpd-$(VERSION)/doc/en && sgml2txt bftpddoc-en.sgml
cd bftpd-$(VERSION) && ln -s doc/en/bftpddoc-en.txt INSTALL
cd bftpd-$(VERSION) && ln -s doc/en/bftpddoc-en.txt README
rm -f -r debian/tmp
cp -a debian bftpd-$(VERSION)
tar c bftpd-$(VERSION) | gzip -v9 > dist/bftpd-$(VERSION).tar.gz
cp -Lr pax bftpd-$(VERSION)
tar c bftpd-$(VERSION) | gzip -v9 > bftpd-$(VERSION)-pax.tar.gz
# Build binary RPM
./configure --enable-pam --enable-libz --enable-pax=pax && make install
cat bftpd.spec.in | sed -e 's/VERSION/$(VERSION)/g' \
> bftpd-$(VERSION)-1.spec
rpm -bb bftpd-$(VERSION)-1.spec
rm -f bftpd-$(VERSION)-1.spec
cp -a /usr/src/rpm/RPMS/i386/bftpd-$(VERSION)-1.i386.rpm \
dist/bftpd-$(VERSION).i386.rpm
# Build binary DEB
mv bftpd-$(VERSION)-pax.tar.gz bftpd-$(VERSION).tar.gz
cd bftpd-$(VERSION) && (\
cat debian/changelog.in | sed -e 's/VERSION/$(VERSION)/g' \
> debian/changelog; \
dpkg-buildpackage; \
) && cd ..
rm -f bftpd-$(VERSION).tar.gz
cp bftpd_$(VERSION)-1_i386.deb dist
rm -f bftpd_*
# Remove temporary directory
rm -rf bftpd-$(VERSION)
tarball: clean
(cd .. && tar czf bftpd-$(VERSION).tar.gz bftpd)