summaryrefslogtreecommitdiff
path: root/packaging/setup.spec
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/setup.spec')
-rw-r--r--packaging/setup.spec123
1 files changed, 123 insertions, 0 deletions
diff --git a/packaging/setup.spec b/packaging/setup.spec
new file mode 100644
index 0000000..0a3703a
--- /dev/null
+++ b/packaging/setup.spec
@@ -0,0 +1,123 @@
+Summary: A set of system configuration and setup files
+Name: setup
+Version: 0.1
+Release: 4
+License: Public Domain
+Group: System/Base
+URL: https://fedorahosted.org/setup/
+Source0: https://fedorahosted.org/releases/s/e/%{name}/%{name}-0.1.tar.bz2
+Patch101: 0001-Prevent-marking-shadow-at-passwd-group.patch
+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
+%patch101 -p1
+./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 -rf %{buildroot}/etc/packaging
+
+mkdir -p %{buildroot}/opt/etc
+#mv %{buildroot}/etc/{passwd,group,shadow,gshadow} %{buildroot}/opt/etc
+%if "%{_repository}" == "wearable"
+mv %{buildroot}/etc/{passwd,group} %{buildroot}/opt/etc
+%endif
+pushd %{buildroot}/etc
+rm -f passwd shadow group gshadow
+%if "%{_repository}" == "wearable"
+ln -s ../opt/etc/passwd
+#ln -s ../opt/etc/shadow
+ln -s ../opt/etc/group
+#ln -s ../opt/etc/gshadow
+%endif
+popd
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/license
+cat COPYING > $RPM_BUILD_ROOT%{_datadir}/license/setup
+
+%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,-)
+%{_datadir}/license/setup
+%if "%{_repository}" == "wearable"
+/etc/passwd
+/etc/group
+%endif
+#/etc/shadow
+#/etc/gshadow
+%if "%{_repository}" == "wearable"
+%config(noreplace) /opt/etc/passwd
+%config(noreplace) /opt/etc/group
+%endif
+#%config(noreplace,missingok) /opt/etc/shadow
+#%config(noreplace,missingok) /opt/etc/gshadow
+
+%if "%{_repository}" == "wearable"
+%verify(not md5 size mtime) %config(noreplace) /opt/etc/passwd
+%verify(not md5 size mtime) %config(noreplace) /opt/etc/group
+%endif
+#%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