# Generated by go2rpm 1.9.0 ## Tests currently crash %bcond_with check %global baserelease 1 %global libsofedbasever 0.n %global libsomajor 1 %global libsoversion %{libsofedbasever}.%{libsomajor} # https://github.com/SUSE/connect-ng %global goipath github.com/SUSE/connect-ng Version: 1.3.0 # REMOVE BEFORE SUBMITTING THIS FOR REVIEW # --- # New Fedora packages should use %%gometa -f, which makes the package # ExclusiveArch to %%golang_arches_future and thus excludes the package from # %%ix86. If the new package is needed as a dependency for another package, # please consider removing that package from %%ix86 in the same way, instead of # building more go packages for i686. If your package is not a leaf package, # you'll need to coordinate the removal of the package's dependents first. # --- # REMOVE BEFORE SUBMITTING THIS FOR REVIEW %gometa -f %global common_description %{expand: SUSEConnect is a command line tool for connecting a client system to the SUSE Customer Center. It will connect the system to your product subscriptions and enable the product repositories/services locally.} %global golicenses LICENSE LICENSE.LGPL %global godocs DIFFERENCES.md README.md\\\ man/SUSEConnect.5.md man/SUSEConnect.8.md\\\ suseconnect/migrationUsage.txt\\\ suseconnect/searchPackagesUsage.txt\\\ suseconnect/connectUsage.txt yast/README.md Name: suseconnect-ng Release: 0%{?dist}.%{baserelease} Summary: Utility to register a system with the SUSE Customer Center License: LGPL-2.1-or-later URL: %{gourl} Source: %{gosource} BuildRequires: go-rpm-macros BuildRequires: systemd-rpm-macros %description %{common_description} %package -n libsuseconnect Summary: Library to interface with the SUSE Customer Center %description -n libsuseconnect %{common_description} This package provides the library for applications to interface with the SUSE Customer Center. %package -n libsuseconnect-devel Summary: Development files to use libsuseconnect Requires: libsuseconnect%{?_isa} = %{version}-%{release} %description -n libsuseconnect-devel %{common_description} This package provides the development files for applications to use the library to interface with the SUSE Customer Center. %gopkg %prep %goprep %autopatch -p1 echo "%{version}-%{release}" > internal/connect/version.txt %generate_buildrequires %go_generate_buildrequires %build # build the library for cmd in libsuseconnect; do %define gocompilerflags -buildmode=c-shared -compiler gc %gobuild -o %{gobuilddir}/lib/$(basename $cmd).so.%{libsoversion} %{goipath}/$cmd ln -sr %{gobuilddir}/lib/$(basename $cmd).so.%{libsoversion} %{gobuilddir}/lib/$(basename $cmd).so mv %{gobuilddir}/lib/$(basename $cmd).so.%{libsofedbasever}.h %{gobuilddir}/lib/$(basename $cmd).h done # build the binary for cmd in suseconnect; do %define gocompilerflags -buildmode=pie -compiler gc %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done # Set up aliases ln -sr %{gobuilddir}/bin/suseconnect %{gobuilddir}/bin/SUSEConnect %install %gopkginstall # binaries install -m 0755 -vd %{buildroot}%{_bindir} cp -av %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # libraries install -m 0755 -vd %{buildroot}%{_libdir} cp -av %{gobuilddir}/lib/*.so* %{buildroot}%{_libdir}/ # headers install -m 0755 -vd %{buildroot}%{_includedir} install -m 0644 -vp %{gobuilddir}/lib/*.h %{buildroot}%{_includedir}/ # systemd units install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0644 -vp *.service *.timer %{buildroot}%{_unitdir}/ %if %{with check} %check %gocheck %endif %files %license LICENSE LICENSE.LGPL %doc DIFFERENCES.md README.md man/SUSEConnect.5.md %doc man/SUSEConnect.8.md %doc suseconnect/migrationUsage.txt suseconnect/searchPackagesUsage.txt %doc suseconnect/connectUsage.txt %{_bindir}/suseconnect %{_bindir}/SUSEConnect %{_unitdir}/suseconnect-keepalive.* %files -n libsuseconnect %license LICENSE LICENSE.LGPL %{_libdir}/libsuseconnect.so.%{libsoversion} %files -n libsuseconnect-devel %{_libdir}/libsuseconnect.so %{_includedir}/libsuseconnect.h %gopkgfiles %changelog * Tue Sep 26 2023 Neal Gompa - 1.3.0-0.1 - Initial package