Skip to content

Commit da38673

Browse files
authored
Merge pull request #33 from RobSanders/UpdateMakefileAndSpecfile
Update makefile and specfile
2 parents 33ce4fe + 28262d7 commit da38673

File tree

2 files changed

+62
-17
lines changed

2 files changed

+62
-17
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ clitest.exe: clitest.c libcli.o
6161
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< libcli.o -lws2_32
6262

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

6666
install: $(TARGET_LIBS)
6767
install -d $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
@@ -76,9 +76,12 @@ install: $(TARGET_LIBS)
7676
ln -fs $(LIB).$(MAJOR).$(MINOR) $(LIB)
7777
endif
7878

79-
rpm:
79+
rpmprep:
80+
rm -rf libcli-$(MAJOR).$(MINOR).$(REVISION)
8081
mkdir libcli-$(MAJOR).$(MINOR).$(REVISION)
81-
cp -R *.c *.h Makefile Doc README *.spec libcli-$(MAJOR).$(MINOR).$(REVISION)
82+
cp -R libcli.{c,h} libcli.spec clitest.c Makefile COPYING README libcli-$(MAJOR).$(MINOR).$(REVISION)
8283
tar zcvf libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz --exclude CVS --exclude *.tar.gz libcli-$(MAJOR).$(MINOR).$(REVISION)
8384
rm -rf libcli-$(MAJOR).$(MINOR).$(REVISION)
84-
rpm -ta libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz --clean
85+
86+
rpm: rpmprep
87+
rpmbuild -ta libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz --define "debug_package %{nil}" --clean

libcli.spec

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version: 1.9.7
1+
Version: 1.9.8
22
Summary: Cisco-like telnet command-line library
33
Name: libcli
44
Release: 1
@@ -8,35 +8,77 @@ Source: %{name}-%{version}.tar.gz
88
URL: http://code.google.com/p/libcli
99
Packager: David Parrish <[email protected]>
1010
BuildRoot: %{_tmppath}/%{name}-%{version}-%(%__id -un)
11+
12+
%define verMajMin %(echo %{version} | cut -d '.' -f 1,2)
13+
14+
%package devel
15+
Summary: Development files for libcli
16+
Group: Development/Libraries
17+
Requires: %{name} = %{version}-%{release}
18+
1119
%description
1220
libcli provides a shared library for including a Cisco-like command-line
1321
interface into other software. It's a telnet interface which supports
1422
command-line editing, history, authentication and callbacks for a
1523
user-definable function tree.
1624

25+
%description devel
26+
libcli provides a shared library for including a Cisco-like command-line
27+
interface into other software. It's a telnet interface which supports
28+
command-line editing, history, authentication and callbacks for a
29+
user-definable function tree.
30+
This package contains the devel files.
31+
1732
%prep
18-
%setup
33+
%setup -q
1934

2035
%build
2136
make
2237

2338
%install
2439
rm -rf $RPM_BUILD_ROOT
25-
make DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr install
26-
find $RPM_BUILD_ROOT/usr ! -type d -print | grep -v '\/(README|\.html)$' | \
27-
sed "s@^$RPM_BUILD_ROOT@@g" | sed "s/^\(.*\)$/\1\*/" > %{name}-%{version}-filelist
40+
install -d -p %{buildroot}%{_includedir}
41+
install -p -m 644 libcli*.h %{buildroot}%{_includedir}/
42+
install -d -p %{buildroot}%{_libdir}
43+
install -p -m 755 libcli.so.%{version} %{buildroot}%{_libdir}/
44+
install -p -m 755 libcli.a %{buildroot}%{_libdir}/
45+
ln -s %{_libdir}/libcli.so.%{version} %{buildroot}%{_libdir}/libcli.so.%{verMajMin}
46+
ln -s %{_libdir}/libcli.so.%{verMajMin} %{buildroot}%{_libdir}/libcli.so
47+
48+
%post -p /sbin/ldconfig
2849

29-
%post
30-
ldconfig
50+
%postun -p /sbin/ldconfig
3151

3252
%clean
3353
rm -rf $RPM_BUILD_ROOT
3454

35-
%files -f %{name}-%{version}-filelist
55+
%files
56+
%doc COPYING
57+
%{_libdir}/*\.so.*
58+
%defattr(-, root, root)
59+
60+
%files devel
61+
%doc README
62+
%{_libdir}/*.so*
63+
%{_libdir}/*.a
64+
%{_includedir}/*.h
3665
%defattr(-, root, root)
3766

3867
%changelog
39-
* Mon Feb 1 2010 David Parrish <[email protected]> 1.9.7-1
68+
* Tue Sep 18 2018 Rob Sanders <[email protected]> 1.9.8-3
69+
- Update spec file similar to EPEL's for regular and devel pacakges
70+
- Update Makefile rpm target to build both regular and devel pacakges
71+
- Update changelog for new fixes)
72+
- Update changelog (fix dates on several commits to avoid rpmbuild complaint)
73+
74+
* Sun Sep 16 2018 David Parrish <[email protected]> 1.9.8-2
75+
- Reformat patches with clang-format
76+
77+
* Thu Sep 13 2018 Rob Sanders <[email protected]> 1.9.8-1
78+
- Fix segfaults processing long lines in cli_loop()
79+
- Fix Coverity identified issues at the 'low' aggressive level
80+
81+
* Sun Jul 22 2012 David Parrish <[email protected]> 1.9.7-1
4082
- Fix memory leak in cli_get_completions - [email protected]
4183

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

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

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

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

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

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

0 commit comments

Comments
 (0)