Skip to content

Commit 254ec8b

Browse files
committed
Makefile and ebuild updated
1 parent 0105f89 commit 254ec8b

File tree

2 files changed

+55
-12
lines changed

2 files changed

+55
-12
lines changed

Makefile

+11-12
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,21 @@ update-conf.d.complex: update-conf.d.complex.in
2020
-rm -f update-conf.d
2121
-ln -s update-conf.d.complex update-conf.d
2222

23-
install:
23+
installdirs:
2424
install -d "$(INSTALLDIR)" "$(CONFIGDIR)" "$(SBINDIR)" "$(MANDIR)"
25-
install -m 750 update-conf.d.simple "$(SBINDIR)"
26-
install -m 750 update-conf.d.complex "$(SBINDIR)"
27-
install -m 640 update-conf.d.8 "$(MANDIR)"
25+
26+
update: installdirs
27+
-install -m 750 update-conf.d.simple update-conf.d.complex "$(SBINDIR)"
2828
install update-conf.d "$(SBINDIR)"
29+
-rm -f "$(SBINDIR)/update-conf.d"
30+
-test -e "$(SBINDIR)/update-conf.d.complex" && ln -s update-conf.d.complex "$(SBINDIR)/update-conf.d"
31+
-test -e "$(SBINDIR)/update-conf.d.simple" && ln -s update-conf.d.simple "$(SBINDIR)/update-conf.d"
32+
install -m 640 update-conf.d.8 "$(MANDIR)"
33+
34+
install: update
2935
-touch "$(CONFIGDIR)/update-conf.d.conf"
3036
-chmod 644 "$(CONFIGDIR)/update-conf.d.conf"
3137

32-
update:
33-
install -d $(INSTALLDIR) $(CONFIGDIR) $(SBINDIR) $(MANDIR)
34-
install -m 750 update-conf.d.simple $(SBINDIR)
35-
install -m 750 update-conf.d.complex $(SBINDIR)
36-
install -m 640 update-conf.d.8 $(MANDIR)
37-
install update-conf.d $(SBINDIR)
38-
3938
uninstall:
4039
-rm -f "$(SBINDIR)/update-conf.d"
4140
-rm -f "$(SBINDIR)/update-conf.d.simple"
@@ -45,4 +44,4 @@ uninstall:
4544
clean:
4645
-rm -f update-conf.d update-conf.d.simple update-conf.d.complex *~
4746

48-
.PHONY: build simple complex update-conf.d.simple update-conf.d.complex install update uninstall clean
47+
.PHONY: build simple complex installdirs update install uninstall clean

update-conf-9999.ebuild

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# $Header$
2+
3+
EAPI=4
4+
inherit git-2
5+
6+
DESCRIPTION="script for flexible /etc/<conf>.d configuration"
7+
HOMEPAGE="http://forums.gentoo.org/viewtopic.php?p=6364143"
8+
EGIT_REPO_URI="git://github.com/Atha/${PN}.d"
9+
10+
LICENSE="GPL-2"
11+
SLOT="0"
12+
KEYWORDS="*"
13+
IUSE="simple"
14+
15+
RDEPEND=""
16+
DEPEND="${RDEPEND}"
17+
18+
DOCS="README USAGE"
19+
20+
src_prepare() {
21+
echo "patching the makefile with s:^PREFIX=:PREFIX=${D}: (required to prevent make to write outside the sandbox)"
22+
sed -i "s:^PREFIX=:PREFIX=${D}:" Makefile
23+
echo "patching the configuration to ensure it looks in /etc instead of in the sandbox"
24+
sed -i 's%@CONFIGDIR@%/etc%' update-conf.d.simple.in
25+
sed -i 's%@CONFIGDIR@%/etc%' update-conf.d.complex.in
26+
echo "patching the makefile so the installation path is /usr instead of /usr/local"
27+
sed -i 's:^INSTALLDIR=\$(PREFIX)/usr/local:INSTALLDIR=\$(PREFIX)/usr:' Makefile
28+
}
29+
30+
src_configure() {
31+
emake clean
32+
if use simple ; then
33+
emake simple
34+
else # default to complex version
35+
emake complex
36+
fi
37+
}
38+
39+
src_compile() {
40+
emake install
41+
42+
dodoc ${DOCS}
43+
# use complex && doman update-conf.d.8
44+
}

0 commit comments

Comments
 (0)