source: ProjectBuilder/projects/dploy/pbconf/devel/dploy-common/rpm/dploy-common.spec@ 392

Last change on this file since 392 was 392, checked in by Bruno Cornec, 16 years ago

spec file ok for dploy-common

File size: 1.7 KB
Line 
1#
2# $Id$
3#
4%define perlvendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
5
6Summary: dploy.org common tools
7Summary(fr): Outils communs pour dploy.org
8
9Name: PBPKG
10Version: PBVER
11Release: PBTAGPBSUF
12License: GPL
13Group: PBGRP
14Url: PBURL
15Source: PBSRC
16BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
17Requires: openssh, PBDEP
18
19%description
20PBDESC
21
22%description -l fr
23Outils communs pour dploy.org
24
25%prep
26%setup -q
27
28%build
29%{__perl} Makefile.PL INSTALLDIRS=vendor PBKEYWORD=${RPM_BUILD_ROOT}/PBFINALDIR
30make
31
32%install
33%{__rm} -rf $RPM_BUILD_ROOT
34export DESTDIR=$RPM_BUILD_ROOT
35export PREFIX=%{_exec_prefix}
36export CONFDIR=%{_sysconfdir}/PBPROJ
37make DESTDIR=$RPM_BUILD_ROOT install
38./install.sh
39find ${RPM_BUILD_ROOT} -name perllocal.pod | xargs rm -f
40
41
42%clean
43%{__rm} -rf $RPM_BUILD_ROOT
44
45%files
46%defattr(-,dploy,dploy)
47%doc ChangeLog
48%config(noreplace) %{_sysconfdir}/PBPROJ
49%doc AUTHORS
50#NEWS
51%doc INSTALL COPYING README
52
53%{perlvendorlib}/*
54#%{_bindir}/*
55#%{_mandir}/man1/*
56%{_mandir}/man3/*
57
58%pre
59# Create dploy Account and group if needed
60grep -qE '^dploy:' /etc/group
61if [ $? -ne 0 ]; then
62 addgroup dploy
63fi
64grep -qE '^dploy:' /etc/passwd
65if [ $? -ne 0 ]; then
66 adduser dploy dploy
67fi
68
69%post
70# Open ssh access for dploy account with generated keys
71mkdir -p ~dploy/.ssh
72chmod 700 ~dploy/.ssh
73keyf=~dploy/.ssh/authorized_keys
74if [ -f $keyf ]; then
75 key=`cut -d' ' -f2 %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub`
76 grep -qE \'$key\' $keyf
77 if [ $? -ne 0 ]; then
78 cat %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub >> $keyf
79 fi
80else
81 cp %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub $keyf
82 chown dploy:dploy $keyf
83 chmod 600 $keyf
84fi
85
86%changelog
87PBLOG
Note: See TracBrowser for help on using the repository browser.