1 | #
|
---|
2 | # Copyright (c) 2004-2013 dass IT GmbH, Koeln, Germany.
|
---|
3 | # This file and all modifications and additions to the pristine
|
---|
4 | # package are under the same license as the package itself.
|
---|
5 | #
|
---|
6 | # $Id: dasscm.spec 1245 2020-01-07 11:18:05Z joergs $
|
---|
7 |
|
---|
8 | Name: dasscm
|
---|
9 | URL: https://trac.dass-it.de/pub/
|
---|
10 | License: GPL-2.0+
|
---|
11 | Group: Development/Tools/Version Control
|
---|
12 | Autoreqprov: on
|
---|
13 | Summary: DASS Configuration Management
|
---|
14 | Version: 1.2
|
---|
15 | Release: 0
|
---|
16 | Requires: subversion perl
|
---|
17 | Source: %{name}_%{version}.orig.tar.gz
|
---|
18 | BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
---|
19 | BuildArch: noarch
|
---|
20 | %if 0%{?suse_version}
|
---|
21 | BuildRequires: gzip tar
|
---|
22 | %endif
|
---|
23 | #BuildRequires: nagios-nrpe
|
---|
24 |
|
---|
25 | # Subversion should be installed during build
|
---|
26 | # to have the directory /etc/subversion/ available.
|
---|
27 | # Unfortunally, it isn't included in all distributions,
|
---|
28 | # therefore we added some checks
|
---|
29 | ##if 0#{?suse_version} > 1100
|
---|
30 | #BuildRequires: subversion
|
---|
31 | ##endif
|
---|
32 |
|
---|
33 |
|
---|
34 | %description
|
---|
35 | dasscm is a tool for handling configuration files with subversion
|
---|
36 |
|
---|
37 | %prep
|
---|
38 | %setup -c
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 | %build
|
---|
43 |
|
---|
44 |
|
---|
45 | %install
|
---|
46 | # call install script
|
---|
47 | ./dasscm.install.sh DESTDIR=$RPM_BUILD_ROOT
|
---|
48 |
|
---|
49 | # handle special files, not useful on all distributions
|
---|
50 | rm -f files
|
---|
51 | touch files
|
---|
52 | if test -e $RPM_BUILD_ROOT/etc/bash_completion.d/dasscm.sh; then
|
---|
53 | echo '%config(noreplace) /etc/bash_completion.d/dasscm.sh' >> files
|
---|
54 | else
|
---|
55 | echo '%doc etc/bash_completion.d/bash_completion_dasscm.sh' >> files
|
---|
56 | fi
|
---|
57 |
|
---|
58 | if test -e $RPM_BUILD_ROOT/etc/nagios/nrpe.d/dasscm.cfg; then
|
---|
59 | #test -d /etc/nagios || echo '%%dir /etc/nagios' >> files
|
---|
60 | #test -d /etc/nagios/nrpe.d || echo '%%dir /etc/nagios/nrpe.d' >> files
|
---|
61 | echo '%config(noreplace) /etc/nagios/nrpe.d/dasscm.cfg' >> files
|
---|
62 | else
|
---|
63 | echo '%doc etc/nagios/nrpe.d/nrpe-dasscm.cfg' >> files
|
---|
64 | fi
|
---|
65 |
|
---|
66 | #cat files
|
---|
67 |
|
---|
68 |
|
---|
69 | %clean
|
---|
70 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
---|
71 |
|
---|
72 | # TODO: group dasscm: 4199
|
---|
73 | # without existing group, #attr(640,root,4199) falls back to root
|
---|
74 | # groupadd -g 4199 dasscm
|
---|
75 |
|
---|
76 | %files -f files
|
---|
77 | %defattr(-,root,root)
|
---|
78 | %dir /var/lib/dasscm/
|
---|
79 | %dir /var/lib/dasscm/plugin-results/
|
---|
80 | /usr/bin/dasscm
|
---|
81 | /usr/bin/dasscm_remote_check.sh
|
---|
82 | /usr/bin/dasscm_remote_update.sh
|
---|
83 | %doc doc/* subversion-servers.dass-it
|
---|
84 |
|
---|
85 | %config(noreplace) %attr(640,root,root) /etc/dasscm.conf
|
---|
86 | %config(noreplace) /etc/profile.d/dasscm.sh
|
---|
87 |
|
---|
88 | # /etc/sudoers.d/ should not belong to dasscm,
|
---|
89 | # but is does currently not exist on most distributions
|
---|
90 | # on Fedora, RHEL/CentOS > 6 produces conflict with sudo package
|
---|
91 | # if it is also owned by this package
|
---|
92 | %if ! 0%{?fedora} && ! 0%{?rhel_version} && ! 0%{?centos_version}
|
---|
93 | %dir /etc/nagios/
|
---|
94 | %dir /etc/nagios/nrpe.d/
|
---|
95 | %dir /etc/sudoers.d/
|
---|
96 | %endif
|
---|
97 | # sudo requires permissions 440 and config files without any "."
|
---|
98 | %attr(440,root,root) %config(noreplace) /etc/sudoers.d/nagios_dasscm_check
|
---|