summaryrefslogtreecommitdiff
path: root/packaging/setup.spec
blob: 0ceb3b24d8117ac811914f3b3421ac4d8015a5dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Summary: A set of system configuration and setup files
Name: setup
Version: 0.1
Release: 1
License: Public Domain
Group: System/Base
URL: https://fedorahosted.org/setup/
Source0: https://fedorahosted.org/releases/s/e/%{name}/%{name}-0.1.tar.bz2
BuildArch: noarch
BuildRequires: bash
Requires: filesystem

%description
The setup package contains a set of important system configuration and
setup files, such as passwd, group, and profile.

%prep
%setup -q 

./shadowconvert.sh

%build

%check
# Run any sanity checks.
#make check

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/etc/profile.d
cp -ar * %{buildroot}/etc
rm -f %{buildroot}/etc/uidgid
rm -f %{buildroot}/etc/COPYING
mkdir -p %{buildroot}/var/log
touch %{buildroot}/var/log/lastlog
touch %{buildroot}/etc/environment
chmod 0644 %{buildroot}/etc/environment
chmod 0400 %{buildroot}/etc/{shadow,gshadow}
chmod 0644 %{buildroot}/var/log/lastlog
touch %{buildroot}/etc/fstab
touch %{buildroot}/etc/mtab

# remove unpackaged files from the buildroot
rm -f %{buildroot}/etc/Makefile
rm -f %{buildroot}/etc/serviceslint
rm -f %{buildroot}/etc/uidgidlint
rm -f %{buildroot}/etc/shadowconvert.sh
rm -f %{buildroot}/etc/setup.spec
rm -f %{buildroot}/etc/packaging

#mkdir -p %{buildroot}/opt/etc
#mv %{buildroot}/etc/{passwd,group,shadow,gshadow} %{buildroot}/opt/etc
pushd %{buildroot}/etc
rm -f passwd shadow group gshadow
#ln -s ../opt/etc/passwd
#ln -s ../opt/etc/shadow
#ln -s ../opt/etc/group
#ln -s ../opt/etc/gshadow
popd

%clean
rm -rf %{buildroot}

#throw away useless and dangerous update stuff until rpm will be able to
#handle it ( http://rpm.org/ticket/6 )
#%post -p <lua>
#for i, name in ipairs({"passwd", "shadow", "group", "gshadow"}) do
#     os.remove("/etc/"..name..".rpmnew")
#end

%files
%defattr(-,root,root,-)
#/etc/passwd
#/etc/group
#/etc/shadow
#/etc/gshadow
#%config(noreplace) /opt/etc/passwd
#%config(noreplace) /opt/etc/group
#%config(noreplace,missingok) /opt/etc/shadow
#%config(noreplace,missingok) /opt/etc/gshadow

#%verify(not md5 size mtime) %config(noreplace) /opt/etc/passwd
#%verify(not md5 size mtime) %config(noreplace) /opt/etc/group
#%verify(not md5 size mtime) %attr(0000,root,root) %config(noreplace,missingok) /opt/etc/shadow
#%verify(not md5 size mtime) %attr(0000,root,root) %config(noreplace,missingok) /opt/etc/gshadow
%verify(not md5 size mtime) %config(noreplace) /etc/services
%verify(not md5 size mtime) %config(noreplace) /etc/exports
%config(noreplace) /etc/aliases
%config(noreplace) /etc/environment
%config(noreplace) /etc/filesystems
%config(noreplace) /etc/host.conf
%verify(not md5 size mtime) %config(noreplace) /etc/hosts
%verify(not md5 size mtime) %config(noreplace) /etc/hosts.allow
%verify(not md5 size mtime) %config(noreplace) /etc/hosts.deny
%verify(not md5 size mtime) %config(noreplace) /etc/motd
%config(noreplace) /etc/printcap
%verify(not md5 size mtime) %config(noreplace) /etc/inputrc
%config(noreplace) /etc/bashrc
%config(noreplace) /etc/profile
%verify(not md5 size mtime) %config(noreplace) /etc/protocols
%attr(0600,root,root) %config(noreplace,missingok) /etc/securetty
%config(noreplace) /etc/csh.login
%config(noreplace) /etc/csh.cshrc
%dir /etc/profile.d
%config(noreplace) %verify(not md5 size mtime) /etc/shells
%ghost %attr(0644,root,root) %verify(not md5 size mtime) /var/log/lastlog
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/fstab
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/mtab