forked from Daenyth/pkgtools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (68 loc) · 2.89 KB
/
Makefile
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
INSTALL = install
INSTALL_DATA = $(INSTALL) -Dm644
INSTALL_PROGRAM = $(INSTALL) -Dm755
INSTALL_CRON = $(INSTALL) -Dm744
prefix = /usr
exec_prefix = $(prefix)
confdir = /etc
bindir = $(exec_prefix)/bin
libdir = $(prefix)/lib
sharedir = $(prefix)/share/pkgtools
cachedir = /var/cache/pkgtools/lists
profiledir = $(confdir)/profile.d
crondir = $(confdir)/cron.daily
mandir = $(prefix)/share/man
.PHONY: all
all: pkgfile.so
install:
# Common functions needed by all scripts
$(INSTALL_DATA) other/functions $(DESTDIR)$(sharedir)/functions
# newpkg
$(INSTALL_PROGRAM) scripts/newpkg $(DESTDIR)$(bindir)/newpkg
$(INSTALL_DATA) other/functions.newpkg $(DESTDIR)$(sharedir)/functions.newpkg
$(INSTALL_DATA) confs/newpkg.conf $(DESTDIR)$(confdir)/pkgtools/newpkg.conf
$(INSTALL) -d $(DESTDIR)$(sharedir)/newpkg/presets/
$(INSTALL) -m644 other/newpkg_presets/* $(DESTDIR)$(sharedir)/newpkg/presets/
# pkgfile
$(INSTALL) -d $(DESTDIR)$(cachedir)
$(INSTALL_PROGRAM) scripts/pkgfile.py $(DESTDIR)$(bindir)/pkgfile
$(INSTALL_DATA) confs/pkgfile.conf $(DESTDIR)$(confdir)/pkgtools/pkgfile.conf
$(INSTALL_CRON) other/pkgfile.cron $(DESTDIR)$(crondir)/pkgfile
# install pkgfile.so module
(cd modules; python3 ./setup.py install --root=$(DESTDIR))
# Loads shell hooks
$(INSTALL_PROGRAM) other/pkgfile-hook.sh $(DESTDIR)$(profiledir)/pkgfile-hook.sh
$(INSTALL_DATA) other/pkgfile-hook.zsh $(DESTDIR)$(sharedir)/pkgfile-hook.zsh
$(INSTALL_DATA) other/pkgfile-hook.bash $(DESTDIR)$(sharedir)/pkgfile-hook.bash
# spec2arch
$(INSTALL_PROGRAM) scripts/spec2arch $(DESTDIR)$(bindir)/spec2arch
$(INSTALL_DATA) confs/spec2arch.conf $(DESTDIR)$(confdir)/pkgtools/spec2arch.conf
$(INSTALL_DATA) doc/spec2arch.1 $(DESTDIR)$(mandir)/man1/spec2arch.1
$(INSTALL_DATA) doc/spec2arch.conf.5 $(DESTDIR)$(mandir)/man5/spec2arch.conf.5
# pkgconflict
$(INSTALL_PROGRAM) scripts/pkgconflict.py $(DESTDIR)$(bindir)/pkgconflict
# whoneeds
$(INSTALL_PROGRAM) scripts/whoneeds.bash $(DESTDIR)$(bindir)/whoneeds
# pkgclean
$(INSTALL_PROGRAM) scripts/pkgclean $(DESTDIR)$(bindir)/pkgclean
# maintpkg
$(INSTALL_PROGRAM) scripts/maintpkg $(DESTDIR)$(bindir)/maintpkg
# gem2arch
$(INSTALL_DATA) doc/gem2arch.1 $(DESTDIR)$(mandir)/man1/gem2arch.1
$(INSTALL) -d $(DESTDIR)$(sharedir)/gem2arch
$(INSTALL_DATA) scripts/gem2arch/*.py $(DESTDIR)$(sharedir)/gem2arch
$(INSTALL_PROGRAM) scripts/gem2arch/gem2arch $(DESTDIR)$(sharedir)/gem2arch
ln -s /$(sharedir)/gem2arch/gem2arch $(DESTDIR)$(bindir)/gem2arch
uninstall:
rm -Rf $(DESTDIR)$(sharedir)
rm $(DESTDIR)$(bindir)/{newpkg,pkgfile,spec2arch,pkgconflict,whoneeds,pkgclean,gem2arch}
rm $(DESTDIR)$(crondir)/pkgfile
rm $(DESTDIR)$(profiledir)/pkgfile-hook.*
rm -Rf $(DESTDIR)$(confdir)/pkgtools
rm $(DESTDIR)$(mandir)/man8/spec2arch.8
rm $(DESTDIR)$(mandir)/man5/spec2arch.conf.5
rm $(DESTDIR)$(mandir)/man1/gem2arch.1
pkgfile.so:
(cd modules; python3 ./setup.py build)
clean:
(rm -rf modules/build)