Commit 0690eea5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eepm.spec: move install code to Makefile

parent 78d102c9
.PHONY: all clean install check install_common install_epm install_serv install_yum
installd_list = pack.d repack.d prescription.d play.d
cmd_list = epm serv yum
.PHONY: all clean install check install_common install_epm install_serv install_yum $(installd_list) $(cmd_list)
pkgdatadir=$(datadir)/eepm
install: install_common install_epm install_serv install_yum
install: install_common install_epm install_serv install_yum $(installd_list) $(cmd_list)
install_common:
mkdir -p $(DESTDIR)$(bindir)/
......@@ -23,21 +26,15 @@ install_common:
mkdir -p $(DESTDIR)$(mandir)/man1
cp -a `ls -1 man/*` $(DESTDIR)$(mandir)/man1/
install_epm:
$(cmd_list):
sed -e "s|SHAREDIR=.*|SHAREDIR=$(pkgdatadir)|g" \
-e "s|CONFIGDIR=.*|CONFIGDIR=$(sysconfdir)/eepm|g" \
-e "s|@VERSION@|$(version)|g" <bin/epm >$(DESTDIR)$(bindir)/epm
-e "s|@VERSION@|$(version)|g" <bin/$@ >$(DESTDIR)$(bindir)/$@
install_serv:
sed -e "s|SHAREDIR=.*|SHAREDIR=$(pkgdatadir)|g" \
-e "s|CONFIGDIR=.*|CONFIGDIR=$(sysconfdir)/eepm|g" \
-e "s|@VERSION@|$(version)|g" <bin/serv >$(DESTDIR)$(bindir)/serv
install_yum:
sed -e "s|SHAREDIR=.*|SHAREDIR=$(pkgdatadir)|g" \
-e "s|CONFIGDIR=.*|CONFIGDIR=$(sysconfdir)/eepm|g" \
-e "s|@VERSION@|$(version)|g" <bin/yum >$(DESTDIR)$(bindir)/yum
$(installd_list):
mkdir -p $(DESTDIR)$(sysconfdir)/eepm/$@/
cp repack.d/* $(DESTDIR)$(sysconfdir)/eepm/$@/
chmod 0755 $(DESTDIR)$(sysconfdir)/eepm/$@/*.sh
check:
......
......@@ -77,30 +77,14 @@ This package contains yum like frontend for Etersoft EPM package manager.
%install
# install to datadir and so on
# do not use uncommon makeinstall_std here
%make_install install DESTDIR=%buildroot datadir=%_datadir bindir=%_bindir mandir=%_mandir sysconfdir=%_sysconfdir version=%version-%release
#install -m 0755 packed/epm.sh %buildroot/%_datadir/%name/epm-packed.sh
#install -m 0755 packed/serv.sh %buildroot/%_datadir/%name/serv-packed.sh
%make_install install DESTDIR=%buildroot \
datadir=%_datadir bindir=%_bindir mandir=%_mandir \
sysconfdir=%_sysconfdir version=%version-%release
cat <<EOF >%buildroot%_sysconfdir/eepm/serv.conf
# serv config (will insource in serv shell script)
EOF
mkdir -p %buildroot%_sysconfdir/eepm/repack.d/
cp repack.d/* %buildroot%_sysconfdir/eepm/repack.d/
chmod 0755 %buildroot%_sysconfdir/eepm/repack.d/*.sh
mkdir -p %buildroot%_sysconfdir/eepm/pack.d/
cp pack.d/* %buildroot%_sysconfdir/eepm/pack.d/
chmod 0755 %buildroot%_sysconfdir/eepm/pack.d/*.sh
mkdir -p %buildroot%_sysconfdir/eepm/prescription.d/
cp prescription.d/* %buildroot%_sysconfdir/eepm/prescription.d/
chmod 0755 %buildroot%_sysconfdir/eepm/prescription.d/*.sh
mkdir -p %buildroot%_sysconfdir/eepm/play.d/
cp play.d/* %buildroot%_sysconfdir/eepm/play.d/
chmod 0755 %buildroot%_sysconfdir/eepm/play.d/*.sh
mkdir -p %buildroot%_sysconfdir/bash_completion.d/
install -m 0644 bash_completion/serv %buildroot%_sysconfdir/bash_completion.d/serv
install -m 0644 bash_completion/cerv %buildroot%_sysconfdir/bash_completion.d/cerv
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment