Name: supernovas Version: 1.0.1 Release: 1%{?dist} Summary: The Naval Observatory's NOVAS C astronomy library, made better License: Unlicense URL: https://smithsonian.github.io/SuperNOVAS/ Source0: https://github.com/Smithsonian/SuperNOVAS/archive/refs/tags/v%{version}.tar.gz BuildRequires: gcc BuildRequires: gcc-gfortran BuildRequires: sed BuildRequires: doxygen >= 1.10.0 %description SuperNOVAS is a C/C++ astronomy library, providing high-precision astronomical calculations such as one might need for running an observatory or a precise planetarium program. It is a fork of the Naval Observatory Vector Astrometry Software (NOVAS) C version 3.1, providing bug fixes and making it easier to use overall. The main goals of SuperNOVAS are to improve usability, add new features, promote best practices, and provide accessible documentation -- all while retaining 100% API compatibility with NOVAS C 3.1. Thus, if you have written code for NOVAS C 3.1, you can build it with SuperNOVAS also. SuperNOVAS is entirely free to use without licensing restrictions. Its source code is compatible with the C90 standard, and hence should be suitable for old and new platforms alike. It is light-weight and easy to use, with full support for the IAU 2000/2006 standards for sub-micro-arc-second position calculations. %package devel Summary: C development files for the SuperNOVAS C/C++ astronomy library Requires: %{name}%{_isa} = %{version}-%{release} %description devel This sub-package provides C headers and non-versioned shared library symbolic links for the SuperNOVAS C/C++ library. %package doc Summary: Documentation for the SuperNOVAS C/C++ astronomy library BuildArch: noarch Requires: %{name} = %{version}-%{release} %description doc This package provides man pages and HTML documentation for the SuperNOVAS C/C++ astronomy library. %prep %setup -q -n SuperNOVAS-%{version} %build CIO_LOCATOR_FILE=%{_datadir}/%{name}/cio_ra.bin # ---------------------------------------------------------------------------- # Future build for SuperNOVAS > 1.0.1 # #make lib/supernovas.so #make lib/solsys1.so #make lib/solsys2.so # # ---------------------------------------------------------------------------- # BEGIN is build for v1.0.1 # We'll modify the build configuration, saving the original first cp config.mk config.bak # Specify where the cio_ra.bin file will be installed sed -i "s:/user/share/novas/cio_ra.bin:%{_datadir}/%{name}/cio_ra.bin:g" config.mk # Use externally defined CFLAGS sed -i "s:CFLAGS = -Os -Wall -I\$(INC):CFLAGS += -I\$(INC):g " config.mk # Use externally defined CFLAGS for tests sed -i "s:-g -I../include \$<:\$(CFLAGS) \$<:g" test/Makefile # Set soname to 'libsupernovas.so.1.x.x' sed -i "s:-shared -fPIC:-shared -fPIC -Wl,-soname,lib%{name}.so.%{version} $(LDFLAGS):g" Makefile # build lib/novas.so make %{?_smp_mflags} shared mv lib/novas.so lib/%{name}.so # solsys1 and solsys2 legacy libs echo "CFLAGS += -shared -fPIC" >> config.mk make %{?_smp_mflags} solsys # Manual build solsys1.so and solsys2.so for packaging gcc -o lib/solsys1.so obj/solsys1.o obj/eph_manager.o -shared -fPIC -Wl,-soname,libsolsys1.so.1 $(LDFLAGS) gcc -o lib/solsys2.so obj/solsys2.o obj/jplint.o -shared -fPIC -Wl,-soname,libsolsys2.so.1 $(LDFLAGS) # The headless README from upstream make %{?_smp_mflags} README-headless.md # man pages and HTML documentation make %{?_smp_mflags} dox mv config.bak config.mk # END is build for v1.0.1 # ---------------------------------------------------------------------------- # make share/cio_ra.bin make %{?_smp_mflags} bin/cio_file mkdir -p share bin/cio_file data/CIO_RA.TXT share/cio_ra.bin %install # ---------------------------------------------------------------------------- # Install libsupernovas.so.1 runtime library mkdir -p %{buildroot}/%{_libdir} # ---------------------------------------------------------------------------- # libsupernovas.so... install -m 755 lib/supernovas.so %{buildroot}/%{_libdir}/lib%{name}.so.%{version} # Link libsopernovas.so.1.x.x -> libsupernovas.so.1 ( cd %{buildroot}/%{_libdir} ; ln -sf lib%{name}.so.{%version} lib%{name}.so.1 ) # Link libsupernovas.so.1 -> libsupernovas.so ( cd %{buildroot}/%{_libdir} ; ln -sf lib%{name}.so.1 lib%{name}.so ) # (compat naming) Link libnovas.so -> libsupernovas.so ( cd %{buildroot}/%{_libdir} ; ln -sf lib%{name}.so libnovas.so ) # ---------------------------------------------------------------------------- # libsolsys1.so install -m 755 lib/solsys1.so %{buildroot}/%{_libdir}/libsolsys1.so.%{version} # Link libsolsys1.so.1.x.x -> libsolsys1.so.1 ( cd %{buildroot}/%{_libdir} ; ln -sf libsolsys1.so.{%version} libsolsys1.so.1 ) # Link libsolsys1.so.1 -> libsolsys1.so ( cd %{buildroot}/%{_libdir} ; ln -sf libsolsys1.so.1 libsolsys1.so ) # ---------------------------------------------------------------------------- # libsolsys2.so install -m 755 lib/solsys2.so %{buildroot}/%{_libdir}/libsolsys2.so.%{version} # Link libsolsys2.so.1.x.x -> libsolsys2.so.1 ( cd %{buildroot}/%{_libdir} ; ln -sf libsolsys2.so.{%version} libsolsys2.so.1 ) # Link libsolsys2.so.1 -> libsolsys2.so ( cd %{buildroot}/%{_libdir} ; ln -sf libsolsys2.so.1 libsolsys2.so ) # ---------------------------------------------------------------------------- # Install runtime CIO locator data mkdir -p %{buildroot}/%{_datadir}/%{name} install -m 644 share/cio_ra.bin %{buildroot}/%{_datadir}/%{name}/cio_ra.bin # ---------------------------------------------------------------------------- # C header files mkdir -p %{buildroot}/%{_prefix}/include install -m 644 -D include/* %{buildroot}/%{_prefix}/include/ # ---------------------------------------------------------------------------- # README, CHANGELOG, and CONTRIBUTING mv README-headless.md README.md # ---------------------------------------------------------------------------- # HTML documentation mkdir -p %{buildroot}/%{_datadir}/%{name}/doc/search install -m 644 -D apidoc/html/search/* %{buildroot}/%{_datadir}/%{name}/doc/search/ rm -rf apidoc/html/search install -m 644 -D apidoc/html/* %{buildroot}/%{_datadir}/%{name}/doc/ install -m 644 apidoc/novas.tag %{buildroot}/%{_datadir}/%{name}/%{name}.tag # ---------------------------------------------------------------------------- # UNIX man pages mkdir -p %{buildroot}/%{_mandir}/man3 install -m 644 -D apidoc/man/man3/* %{buildroot}/%{_mandir}/man3/ %files %license LICENSE %{_libdir}/lib%{name}.so.1{,.*} %{_libdir}/libsolsys1.so.1{,.*} %{_libdir}/libsolsys2.so.1{,.*} %dir %{_datadir}/%{name} %{_datadir}/%{name}/cio_ra.bin %files devel %doc README.md CHANGELOG.md CONTRIBUTING.md %{_prefix}/include/* %{_libdir}/*.so %files doc %doc %{_datadir}/%{name}/%{name}.tag %doc %{_datadir}/%{name}/doc %{_mandir}/man3/* %changelog %autochangelog