Skip to content

Instantly share code, notes, and snippets.

@Aricg
Created September 3, 2014 20:14
Show Gist options
  • Select an option

  • Save Aricg/56420a7755e224cfc149 to your computer and use it in GitHub Desktop.

Select an option

Save Aricg/56420a7755e224cfc149 to your computer and use it in GitHub Desktop.
Two example spec files.
Name: libnetconf
Version: 0.8.0
Release: 1%{?dist}
Summary: NETCONF library in C
Group:foo
License: The BSD 3-Clause License
URL: https://code.google.com/p/libnetconf/
Source0: libnetconf-0.8.0.tar
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: libtool
%description
libnetconf is a NETCONF library in C intended for building NETCONF clients and servers. It provides basic functions to connect NETCONF client and server to each other via SSH, to send and receive NETCONF messages and to store and work with the configuration data in a datastore.
%prep
%setup -q
%build
%configure --with-nacm-recovery-uid=0
sed -i "/cd dev-tools\/lncdatastore/ s/$/ CPPFLAGS='\$(CPPFLAGS)' CFLAGS='\$(CFLAGS)'/" Makefile
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/bin/lncdatastore
make install DESTDIR=%{buildroot}
%clean
rm -rf %{buildroot}
/usr/bin/libtool --finish /usr/local/lib
%files
/usr/bin/lncdatastore/lncdatastore
/usr/include/libnetconf.h
/usr/include/libnetconf/callbacks.h
/usr/include/libnetconf/callbacks_ssh.h
/usr/include/libnetconf/callhome.h
/usr/include/libnetconf/datastore.h
/usr/include/libnetconf/datastore_custom.h
/usr/include/libnetconf/datastore_xml.h
/usr/include/libnetconf/error.h
/usr/include/libnetconf/messages.h
/usr/include/libnetconf/messages_xml.h
/usr/include/libnetconf/netconf.h
/usr/include/libnetconf/notifications.h
/usr/include/libnetconf/notifications_xml.h
/usr/include/libnetconf/session.h
/usr/include/libnetconf/transapi.h
/usr/include/libnetconf/transport.h
/usr/include/libnetconf/url.h
/usr/include/libnetconf/with_defaults.h
/usr/include/libnetconf_ssh.h
/usr/include/libnetconf_xml.h
/usr/lib64/libnetconf.a
/usr/lib64/libnetconf.la
/usr/lib64/libnetconf.so
/usr/lib64/libnetconf.so.0
/usr/lib64/libnetconf.so.0.8.0
/usr/lib64/pkgconfig/libnetconf.pc
/var/lib/libnetconf/ietf-netconf-acm-data.rng
/var/lib/libnetconf/ietf-netconf-acm-gdefs.rng
/var/lib/libnetconf/ietf-netconf-acm-schematron.xsl
/var/lib/libnetconf/yin2yang.xsl
%defattr(-,root,root,-)
%doc
%changelog
####################################################################################################################################
Name: netopeer-server-sl
Version: 0.6.0
Release: 1%{?dist}
Summary: Original libnetconf example server
Group:foo
License: The BSD 3-Clause License
URL: https://code.google.com/p/netopeer/
Source0: netopeer-server-sl-0.6.0.tar
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: libevent >= 2.0
%description
Original libnetconf example server following the single-level architecture. By default, it controls example toaster module.
%prep
%setup -q
%build
export CPPFLAGS="-I/opt/libevent2/usr/include/event2 -I/opt/libevent2/usr/include/"
export LIBNETCONF_LIBS="/usr/local/lib/libnetconf.so.0"
export LIBNETCONF_CFLAGS="-g -O2"
%configure
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
%clean
rm -rf %{buildroot}
%files
/usr/bin/netopeer-server-sl
/var/lib/libnetconf/server/toaster-data.rng
/var/lib/libnetconf/server/toaster-gdefs.rng
/var/lib/libnetconf/server/toaster-schematron.xsl
/var/lib/libnetconf/server/toaster.la
/var/lib/libnetconf/server/toaster.so
/var/lib/libnetconf/server/toaster.yin
%defattr(-,root,root,-)
%doc
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment