Skip to content

Commit

Permalink
Merge pull request #33 from RobSanders/UpdateMakefileAndSpecfile
Browse files Browse the repository at this point in the history
Update makefile and specfile
  • Loading branch information
dparrish authored Sep 19, 2018
2 parents 33ce4fe + 28262d7 commit da38673
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 17 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ clitest.exe: clitest.c libcli.o
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< libcli.o -lws2_32

clean:
rm -f *.o $(LIB)* $(LIB_STATIC) clitest
rm -f *.o $(LIB)* $(LIB_STATIC) clitest libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz

install: $(TARGET_LIBS)
install -d $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
Expand All @@ -76,9 +76,12 @@ install: $(TARGET_LIBS)
ln -fs $(LIB).$(MAJOR).$(MINOR) $(LIB)
endif

rpm:
rpmprep:
rm -rf libcli-$(MAJOR).$(MINOR).$(REVISION)
mkdir libcli-$(MAJOR).$(MINOR).$(REVISION)
cp -R *.c *.h Makefile Doc README *.spec libcli-$(MAJOR).$(MINOR).$(REVISION)
cp -R libcli.{c,h} libcli.spec clitest.c Makefile COPYING README libcli-$(MAJOR).$(MINOR).$(REVISION)
tar zcvf libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz --exclude CVS --exclude *.tar.gz libcli-$(MAJOR).$(MINOR).$(REVISION)
rm -rf libcli-$(MAJOR).$(MINOR).$(REVISION)
rpm -ta libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz --clean

rpm: rpmprep
rpmbuild -ta libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz --define "debug_package %{nil}" --clean
68 changes: 55 additions & 13 deletions libcli.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version: 1.9.7
Version: 1.9.8
Summary: Cisco-like telnet command-line library
Name: libcli
Release: 1
Expand All @@ -8,35 +8,77 @@ Source: %{name}-%{version}.tar.gz
URL: http://code.google.com/p/libcli
Packager: David Parrish <[email protected]>
BuildRoot: %{_tmppath}/%{name}-%{version}-%(%__id -un)

%define verMajMin %(echo %{version} | cut -d '.' -f 1,2)

%package devel
Summary: Development files for libcli
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description
libcli provides a shared library for including a Cisco-like command-line
interface into other software. It's a telnet interface which supports
command-line editing, history, authentication and callbacks for a
user-definable function tree.

%description devel
libcli provides a shared library for including a Cisco-like command-line
interface into other software. It's a telnet interface which supports
command-line editing, history, authentication and callbacks for a
user-definable function tree.
This package contains the devel files.

%prep
%setup
%setup -q

%build
make

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr install
find $RPM_BUILD_ROOT/usr ! -type d -print | grep -v '\/(README|\.html)$' | \
sed "s@^$RPM_BUILD_ROOT@@g" | sed "s/^\(.*\)$/\1\*/" > %{name}-%{version}-filelist
install -d -p %{buildroot}%{_includedir}
install -p -m 644 libcli*.h %{buildroot}%{_includedir}/
install -d -p %{buildroot}%{_libdir}
install -p -m 755 libcli.so.%{version} %{buildroot}%{_libdir}/
install -p -m 755 libcli.a %{buildroot}%{_libdir}/
ln -s %{_libdir}/libcli.so.%{version} %{buildroot}%{_libdir}/libcli.so.%{verMajMin}
ln -s %{_libdir}/libcli.so.%{verMajMin} %{buildroot}%{_libdir}/libcli.so

%post -p /sbin/ldconfig

%post
ldconfig
%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}-%{version}-filelist
%files
%doc COPYING
%{_libdir}/*\.so.*
%defattr(-, root, root)

%files devel
%doc README
%{_libdir}/*.so*
%{_libdir}/*.a
%{_includedir}/*.h
%defattr(-, root, root)

%changelog
* Mon Feb 1 2010 David Parrish <[email protected]> 1.9.7-1
* Tue Sep 18 2018 Rob Sanders <[email protected]> 1.9.8-3
- Update spec file similar to EPEL's for regular and devel pacakges
- Update Makefile rpm target to build both regular and devel pacakges
- Update changelog for new fixes)
- Update changelog (fix dates on several commits to avoid rpmbuild complaint)

* Sun Sep 16 2018 David Parrish <[email protected]> 1.9.8-2
- Reformat patches with clang-format

* Thu Sep 13 2018 Rob Sanders <[email protected]> 1.9.8-1
- Fix segfaults processing long lines in cli_loop()
- Fix Coverity identified issues at the 'low' aggressive level

* Sun Jul 22 2012 David Parrish <[email protected]> 1.9.7-1
- Fix memory leak in cli_get_completions - [email protected]

* Tue Jun 5 2012 Teemu Karimerto <[email protected]> 1.9.6-1
Expand All @@ -55,13 +97,13 @@ rm -rf $RPM_BUILD_ROOT
- Migrate development to Google Code
- Remove docs as they were out of date and now migrated to Google Code wiki

* Fri Jul 28 2008 David Parrish <[email protected]> 1.9.3-1
* Sun Jul 27 2008 David Parrish <[email protected]> 1.9.3-1
- Add support for compiling on WIN32 (Thanks Hamish Coleman)
- Fix cli_build_shortest() length handling
- Don't call cli_build_shortest() when registering every command
- Disable TAB completion during username entry

* Fri Jun 2 2008 David Parrish <[email protected]> 1.9.2-1
* Fri May 2 2008 David Parrish <[email protected]> 1.9.2-1
- Add configurable timeout for cli_regular() - defaults to 1 second
- Add idle timeout support

Expand All @@ -77,10 +119,10 @@ rm -rf $RPM_BUILD_ROOT
- Many code cleanups and optimisations
- Fix memory leak calling cli_loop() repeatedly - Thanks Qiang Wu

* Mon Jan 19 2007 David Parrish <[email protected]> 1.8.8-1
* Sun Feb 18 2007 David Parrish <[email protected]> 1.8.8-1
- Fix broken auth_callback logic - Thanks Ben Menchaca

* Sat Jun 17 2006 Brendan O'Dea <[email protected]> 1.8.7-1
* Thu Jun 22 2006 Brendan O'Dea <[email protected]> 1.8.7-1
- Code cleanups.
- Declare internal functions static.
- Use private data in cli_def rather than static buffers for do_print
Expand Down

0 comments on commit da38673

Please sign in to comment.