rpm UPDATE packaging from Fedora
Fedora package sources:
https://src.fedoraproject.org/rpms/libnetconf2
diff --git a/distro/config/apkg.toml b/distro/config/apkg.toml
index 49a5ead..cbcd96d 100644
--- a/distro/config/apkg.toml
+++ b/distro/config/apkg.toml
@@ -3,8 +3,8 @@
make_archive_script = "distro/scripts/make-archive.sh"
[upstream]
-archive_url = "https://github.com/CESNET/libnetconf2/archive/refs/tags/v{{ version }}.tar.gz"
+archive_url = "https://github.com/CESNET/libnetconf2/archive/v{{ version }}/libnetconf2-{{ version }}.tar.gz"
version_script = "distro/scripts/upstream-version.sh"
[apkg]
-compat = 1
+compat = 2
diff --git a/distro/pkg/rpm/libnetconf2.spec b/distro/pkg/rpm/libnetconf2.spec
index 738e090..6187253 100644
--- a/distro/pkg/rpm/libnetconf2.spec
+++ b/distro/pkg/rpm/libnetconf2.spec
@@ -3,11 +3,10 @@
Release: {{ release }}%{?dist}
Summary: NETCONF protocol library
Url: https://github.com/CESNET/libnetconf2
-Source: libnetconf2-%{version}.tar.gz
+Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
License: BSD
BuildRequires: cmake
-BuildRequires: make
BuildRequires: gcc
BuildRequires: libssh-devel
BuildRequires: openssl-devel
@@ -17,6 +16,7 @@
Summary: Headers of libnetconf2 library
Conflicts: libnetconf-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: pkgconfig
%description devel
Headers of libnetconf library.
@@ -28,27 +28,22 @@
%prep
%autosetup -p1
-mkdir build
%build
-cd build
-cmake \
- -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
- -DCMAKE_BUILD_TYPE:String="Release" \
- -DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \
- -DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" \
- ..
-make
+%cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
+%cmake_build
%install
-cd build
-make DESTDIR=%{buildroot} install
+%cmake_install
+
%files
%license LICENSE
+%doc README.md FAQ.md
%{_libdir}/libnetconf2.so.*
%files devel
+%doc CODINGSTYLE.md
%{_libdir}/libnetconf2.so
%{_libdir}/pkgconfig/libnetconf2.pc
%{_includedir}/*.h
@@ -57,5 +52,5 @@
%changelog
-* Tue Oct 12 2021 Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-{{ release }}
+* {{ now }} Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-{{ release }}
- upstream package