Blob Blame History Raw
%global plugin_name fas
%global ipa_version 4.8.2

%if 0%{?rhel}
%global freeipa_prefix ipa
%global freeipa_altprefix freeipa
%global freeipa_prefix freeipa
%global freeipa_altprefix ipa

Name:           freeipa-%{plugin_name}
Version:        0.0.4
Release:        2%{?dist}
Summary:        Fedora Account System extension for FreeIPA

License:        GPLv3+
URL:  {plugin_name}
Source0:        %{url}/archive/v%{version}/freeipa-%{plugin_name}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  systemd-rpm-macros

%if ! 0%{?rhel}
Provides:        %{freeipa_altprefix}-%{plugin_name} = %{version}-%{release}
Requires:        freeipa-server >= %{ipa_version}
Requires(post):  freeipa-server >= %{ipa_version}

A module for FreeIPA with extensions for Fedora Account System.

%if 0%{?rhel}
%package -n ipa-%{plugin_name}
Summary:        Fedora Account System extension for IdM

Provides:        %{freeipa_altprefix}-%{plugin_name} = %{version}-%{release}
Requires:        ipa-server >= %{ipa_version}
Requires(post):  ipa-server >= %{ipa_version}

%description -n ipa-%{plugin_name}
A module for IdM with extensions for Fedora Account System.

%autosetup -n freeipa-%{plugin_name}-%{version}

# Nothing to build


mkdir -p %{buildroot}%{python3_sitelib}/ipaserver/plugins
for j in $(find ipaserver/plugins -name '*.py') ; do
    cp -a $j %{buildroot}%{python3_sitelib}/ipaserver/plugins

mkdir -p %{buildroot}/%{_datadir}/ipa/schema.d
for j in $(find schema.d/ -name '*.ldif') ; do
    cp -a $j %{buildroot}/%{_datadir}/ipa/schema.d/

mkdir -p %{buildroot}/%{_datadir}/ipa/updates
for j in $(find updates/ -name '*.update') ; do
    cp -a $j %{buildroot}/%{_datadir}/ipa/updates/

mkdir -p %{buildroot}/%{_datadir}/ipa/ui/js/plugins
for j in $(find ui/ -name '*.js') ; do
    destdir=%{buildroot}/%{_datadir}/ipa/ui/js/plugins/$(basename ${j%%.js})
    mkdir -p $destdir
    cp -a $j $destdir/

%posttrans -n %{freeipa_prefix}-%{plugin_name}
%python3 -c "import sys; from ipaserver.install import installutils; sys.exit(0 if installutils.is_ipa_configured() else 1);" > /dev/null 2>&1

if [ $? -eq 0 ]; then
    # This must be run in posttrans so that updates from previous
    # execution that may no longer be shipped are not applied.
    /usr/sbin/ipa-server-upgrade --quiet >/dev/null || :

    # Restart IPA processes. This must be also run in postrans so that plugins
    # and software is in consistent state
    # NOTE: systemd specific section
    /bin/systemctl try-restart ipa.service >/dev/null 2>&1 || :

%files -n %{freeipa_prefix}-%{plugin_name}
%license COPYING

* Tue Jan 26 2021 Fedora Release Engineering <> - 0.0.4-2
- Rebuilt for

* Fri Oct 30 2020 Neal Gompa <> - 0.0.4-1
- Update to 0.0.4

* Sun Oct 04 2020 Neal Gompa <> - 0.0.2-1.git20200921.04a0d2b
- Update to new git snapshot

* Sun Jul 26 2020 Neal Gompa <> - 0.0.2-1.git20200610.b82302d
- Update to new git snapshot

* Mon Apr 20 2020 Neal Gompa <> - 0.0.2-1.git20200422.2b4470e
- Small cleanups and consistency fixes of the packaging

* Wed Feb 12 2020 Christian Heimes <> - 0.0.2-1
- Make new fields readable
- Make mail attribute writeable

* Tue Nov 19 2019 Christian Heimes <> - 0.0.1-1
- Initial release