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

Last change on this file since 422 was 422, checked in by Bruno Cornec, 16 years ago
  • Modifications for LinuxCOE to support pb 0.9.2
  • improvements in dploy packages
File size: 1.8 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)
17BuildArch: noarch
18Requires: openssh, PBDEP
19
20%description
21PBDESC
22
23%description -l fr
24Outils communs pour dploy.org
25
26%prep
27%setup -q
28
29%build
30%{__perl} Makefile.PL INSTALLDIRS=vendor PBKEYWORD=${RPM_BUILD_ROOT}/PBFINALDIR
31make
32
33%install
34%{__rm} -rf $RPM_BUILD_ROOT
35export DESTDIR=$RPM_BUILD_ROOT
36export PREFIX=%{_exec_prefix}
37export CONFDIR=%{_sysconfdir}/PBPROJ
38make DESTDIR=$RPM_BUILD_ROOT install
39./install.sh
40find ${RPM_BUILD_ROOT} -name perllocal.pod | xargs rm -f
41
42
43%clean
44%{__rm} -rf $RPM_BUILD_ROOT
45
46%files
47%defattr(-,dploy,dploy)
48%doc ChangeLog
49%config(noreplace) %{_sysconfdir}/PBPROJ
50%doc AUTHORS
51#NEWS
52%doc INSTALL COPYING README
53
54%{perlvendorlib}/*
55#%{_bindir}/*
56#%{_mandir}/man1/*
57%{_sysconfdir}/PBPROJ
58%{_mandir}/man3/*
59
60%pre
61# Create dploy Account and group if needed
62grep -qE '^dploy:' /etc/group
63if [ $? -ne 0 ]; then
64 addgroup dploy
65fi
66grep -qE '^dploy:' /etc/passwd
67if [ $? -ne 0 ]; then
68 adduser dploy dploy
69fi
70
71%post
72# Open ssh access for dploy account with generated keys
73mkdir -p ~dploy/.ssh
74chmod 700 ~dploy/.ssh
75keyf=~dploy/.ssh/authorized_keys
76if [ -f $keyf ]; then
77 key=`cut -d' ' -f2 %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub`
78 grep -qE \'$key\' $keyf
79 if [ $? -ne 0 ]; then
80 cat %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub >> $keyf
81 fi
82else
83 cp %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub $keyf
84 chown dploy:dploy $keyf
85 chmod 600 $keyf
86fi
87
88%changelog
89PBLOG
Note: See TracBrowser for help on using the repository browser.