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

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