File samba-repo.spec of Package samba-repo

#
# spec file for package samba-repo (Version 0.0.2)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           samba-repo
Version:        0.0.2
Release:        2
Summary:        Repository Configuration Files of network:samba
License:        GPLv3+
Group:          Productivity/Networking/Samba
Source:         COPYING
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package creates repo sub packages which include software repositories
usable by yum, smart and zypp.

%package network_samba_STABLE
License:        GPLv3+
Summary:        Repository Configuration Files of network:samba:STABLE
Conflicts:      network_samba_TESTING
Group:          Productivity/Networking/Samba

%description network_samba_STABLE
This package creates repository definition files to enable the install of the
Samba packages provided with the help of the openSUSE Build Service (OBS).

Call "YaST -> Software -> Online Update" and search for samba.  Next select
the components you like to install.

Or from the command line call "zypper dup -r network_samba_STABLE" to "dup"
all packages available from the network_samba_STABLE repository.

%package network_samba_TESTING
License:        GPLv3+
Summary:        Repository Configuration Files of network:samba:TESTING
Conflicts:      network_samba_STABLE
Group:          Productivity/Networking/Samba

%description network_samba_TESTING
This package creates repository definition files to enable the install of the
Samba packages provided with the help of the openSUSE Build Service (OBS).

Call "YaST -> Software -> Online Update" and search for samba.  Next select
the components you like to install.

Or from the command line call "zypper dup -r network_samba_TESTING" to "dup"
all packages available from the network_samba_TESTING repository.

%prep

%build

%install
%__install -d -m 0755 -p \
	${RPM_BUILD_ROOT}/%{_sysconfdir}/zypp/repos.d
for repo_flavour in network_samba_STABLE network_samba_TESTING; do
	repo_state="${repo_flavour##*_}"
	echo -e "[${repo_flavour}]
name=${repo_flavour}
enabled=1
autorefresh=1
baseurl=http://download.opensuse.org/repositories/network:/samba:/${repo_state}/%{_repository}/
path=/
type=rpm-md
#priority=20
keeppackages=0" >${RPM_BUILD_ROOT}/%{_sysconfdir}/zypp/repos.d/${repo_flavour}.repo
done
mkdir -p ${RPM_BUILD_ROOT}/%{_defaultdocdir}/samba-repo/
cp -a ${RPM_SOURCE_DIR}/COPYING ${RPM_BUILD_ROOT}/%{_defaultdocdir}/samba-repo/

%files network_samba_STABLE
%defattr(-,root,root)
%dir /etc/zypp
%dir /etc/zypp/repos.d
%config(noreplace) /etc/zypp/repos.d/network_samba_STABLE.repo
%dir %{_defaultdocdir}/samba-repo
%{_defaultdocdir}/samba-repo/COPYING

%files network_samba_TESTING
%defattr(-,root,root)
%dir /etc/zypp
%dir /etc/zypp/repos.d
%config(noreplace) /etc/zypp/repos.d/network_samba_TESTING.repo
%dir %{_defaultdocdir}/samba-repo
%{_defaultdocdir}/samba-repo/COPYING

%changelog
openSUSE Build Service is sponsored by