diff --git a/AIX/net-snmp/7.2/Build-notes b/AIX/net-snmp/7.2/Build-notes new file mode 100644 index 0000000..56ad611 --- /dev/null +++ b/AIX/net-snmp/7.2/Build-notes @@ -0,0 +1,18 @@ +Build notes + +download net-snmp-5.7.3.tar.gz from http://www.net-snmp.org/download.html +cp net-snmp-5.7.3.tar.gz /opt/freeware/src/packages/SOURCES +cp net-snmp.5.7.3.spec /opt/freeware/src/packages/SPECS +cp net-snmp-configure.patch /opt/freeware/src/packages/SPECS +cp net-snmp-configure1.patch /opt/freeware/src/packages/SPECS +cp net-snmp-configure2.patch /opt/freeware/src/packages/SPECS +cp net-snmp-ltmain.patch /opt/freeware/src/packages/SPECS +cp net-snmp-libtool.patch /opt/freeware/src/packages/SPECS + run rpm -bb net-snmp.5.7.3.spec + +* patch was created using "diff -c net-snmp-5.7.3.orig/net-snmp-5.7.3/dist/find-requires net-snmp-5.7.3/dist/find-requires" command + +Will build the following rpms: +net-snmp-5.7.3-1.aix7.2.ppc.rpm +net-snmp-devel-5.7.3-1.aix7.2.ppc.rpm +net-snmp-perl-5.7.3-1.aix7.2.ppc.rpm diff --git a/AIX/net-snmp/7.2/net-snmp-configure.patch b/AIX/net-snmp/7.2/net-snmp-configure.patch new file mode 100644 index 0000000..60eac8b --- /dev/null +++ b/AIX/net-snmp/7.2/net-snmp-configure.patch @@ -0,0 +1,125 @@ +*** net-snmp-5.7.2/configure.orig Wed Apr 10 09:43:23 2013 +--- net-snmp-5.7.2/configure Wed Apr 10 09:51:13 2013 +*************** +*** 8845,8853 **** + # whether `pass_all' will *always* work, you probably want this one. + + case $host_os in +! aix[4-9]*) +! lt_cv_deplibs_check_method=pass_all +! ;; + + beos*) + lt_cv_deplibs_check_method=pass_all +--- 8845,8853 ---- + # whether `pass_all' will *always* work, you probably want this one. + + case $host_os in +! aix*) +! lt_cv_deplibs_check_method=pass_all +! ;; + + beos*) + lt_cv_deplibs_check_method=pass_all +*************** +*** 12420,12426 **** + + # See if GNU ld supports shared libraries. + case $host_os in +! aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no +--- 12420,12426 ---- + + # See if GNU ld supports shared libraries. + case $host_os in +! aix*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no +*************** +*** 12687,12693 **** + fi + ;; + +! aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. +--- 12687,12693 ---- + fi + ;; + +! aix*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. +*************** +*** 12709,12715 **** + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. +! case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes +--- 12709,12715 ---- + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. +! case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]* | aix*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes +*************** +*** 13803,13809 **** + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +! aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no +--- 13803,13809 ---- + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +! aix*) + version_type=linux + need_lib_prefix=no + need_version=no +*************** +*** 15174,15180 **** + fi + ;; + +! aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi +--- 15174,15180 ---- + fi + ;; + +! aix*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi +*************** +*** 15630,15636 **** + # + + case $target_os in +! aix4.2*|aix4.3*|aix5*|aix6*|aix7*) + # Runtime linking flags (AIX) + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what linker flags to add to enable runtime linking on AIX" >&5 +--- 15630,15636 ---- + # + + case $target_os in +! aix4.2*|aix4.3*|aix5*|aix6*|aix7*|aix*) + # Runtime linking flags (AIX) + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what linker flags to add to enable runtime linking on AIX" >&5 diff --git a/AIX/net-snmp/7.2/net-snmp-configure2.patch b/AIX/net-snmp/7.2/net-snmp-configure2.patch new file mode 100644 index 0000000..4efff24 --- /dev/null +++ b/AIX/net-snmp/7.2/net-snmp-configure2.patch @@ -0,0 +1,19 @@ +*** net-snmp-5.7.2/configure.orig Fri Apr 19 16:58:08 2013 +--- net-snmp-5.7.2/configure Fri Apr 19 16:59:02 2013 +*************** +*** 13836,13842 **** + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. +! library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH +--- 13836,13842 ---- + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. +! library_names_spec='${libname}${release}.a $libname.so $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH diff --git a/AIX/net-snmp/7.2/net-snmp-libtool.patch b/AIX/net-snmp/7.2/net-snmp-libtool.patch new file mode 100644 index 0000000..a6b1f86 --- /dev/null +++ b/AIX/net-snmp/7.2/net-snmp-libtool.patch @@ -0,0 +1,19 @@ +*** net-snmp-5.7.2/m4/libtool.m4.orig Fri Apr 19 16:20:43 2013 +--- net-snmp-5.7.2/m4/libtool.m4 Fri Apr 19 16:26:16 2013 +*************** +*** 2230,2236 **** + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. +! library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH +--- 2230,2236 ---- + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. +! library_names_spec='${libname}${release}.a $libname.so $libname.so.${release} $libname.so.$major $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH diff --git a/AIX/net-snmp/7.2/net-snmp-ltmain.patch b/AIX/net-snmp/7.2/net-snmp-ltmain.patch new file mode 100644 index 0000000..8ce8806 --- /dev/null +++ b/AIX/net-snmp/7.2/net-snmp-ltmain.patch @@ -0,0 +1,104 @@ +*** net-snmp-5.7.2/ltmain.sh.orig Thu Apr 11 11:20:03 2013 +--- net-snmp-5.7.2/ltmain.sh Thu Apr 11 11:19:46 2013 +*************** +*** 3011,3017 **** + for linkname + do + test "$linkname" != "$realname" \ +! && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + +--- 3011,3017 ---- + for linkname + do + test "$linkname" != "$realname" \ +! && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM -f $linkname && $LN_S $realname $linkname; }; })" + done + fi + +*************** +*** 8262,8268 **** + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then +! $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. +--- 8262,8268 ---- + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then +! $opt_dry_run || eval '(cd $output_objdir && $RM -f ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. +*************** +*** 8528,8534 **** + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ +! $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + +--- 8528,8534 ---- + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ +! $RM -f "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + +*************** +*** 8539,8545 **** + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then +! $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then +--- 8539,8545 ---- + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then +! $opt_dry_run || eval '(cd $output_objdir && $RM -f ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then +*************** +*** 8553,8559 **** + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then +! func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + +--- 8553,8559 ---- + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then +! func_show_eval '(cd "$output_objdir" && $RM -f "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + +*************** +*** 9410,9416 **** + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. +! func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +--- 9410,9416 ---- + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. +! func_show_eval '( cd "$output_objdir" && $RM -f "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS diff --git a/AIX/net-snmp/7.2/net-snmp.5.7.3.spec b/AIX/net-snmp/7.2/net-snmp.5.7.3.spec new file mode 100644 index 0000000..2bfeb9f --- /dev/null +++ b/AIX/net-snmp/7.2/net-snmp.5.7.3.spec @@ -0,0 +1,269 @@ +# +# 5.4+ enables Perl by default +# + +# because perl(Tk) is optional, automatic dependencies will never succeed: +%define _use_internal_dependency_generator 1 +%define __find_requires %{_builddir}/net-snmp-%{version}/dist/find-requires +%define __find_provides /usr/lib/rpm/find-provides +%define _perl_dir /usr/opt/perl5 + +Summary: Tools and servers for the SNMP protocol +Name: net-snmp +Version: 5.7.3 +# update release for vendor release. (eg 1.fc6, 1.rh72, 1.ydl3, 1.ydl23) +Release: 2 +URL: http://www.net-snmp.org/ +License: BSDish +Group: System Environment/Daemons +Vendor: Net-SNMP project +Source: http://prdownloads.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz +#Prereq: openssl +Obsoletes: cmu-snmp ucd-snmp ucd-snmp-utils +BuildRoot: /tmp/%{name}-root +Packager: The Net-SNMP Coders +#Requires: +BuildRequires: coreutils +Patch0: net-snmp-ltmain.patch +Patch1: net-snmp-configure.patch +#Patch2: net-snmp-configure1.patch +Patch3: net-snmp-configure2.patch +Patch4: net-snmp-libtool.patch + +%description + +Net-SNMP provides tools and libraries relating to the Simple Network +Management Protocol including: An extensible agent, An SNMP library, +tools to request or set information from SNMP agents, tools to +generate and handle SNMP traps, etc. Using SNMP you can check the +status of a network of computers, routers, switches, servers, ... to +evaluate the state of your network. + +%package devel +Group: Development/Libraries +Summary: The includes and static libraries from the Net-SNMP package. +AutoReqProv: no +Requires: net-snmp = %{version} +Obsoletes: cmu-snmp-devel ucd-snmp-devel + +%description devel +The net-snmp-devel package contains headers and libraries which are +useful for building SNMP applications, agents, and sub-agents. + +%package perl +Group: Development/Libraries +Summary: The perl NET-SNMP module and the mib2c tool +AutoReqProv: no +Requires: %{name} = %{version} + +%description perl +The net-snmp-perl package contains the perl files to use SNMP from within +Perl. + +Install the net-snmp-perl package, if you want to use mib2c or SNMP with perl. + +%prep +%setup -q -n %{name}-%{version} +%patch0 -p1 +%patch1 -p1 +#%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +%build + +export CC=cc_r +export PATH=/usr/vac/bin:$PATH +./configure \ + --prefix="/opt/freeware" \ + --enable-static=snmptrapd \ + --enable-shared \ + --with-logfile="/var/log/snmpd.log" \ + --with-persistent-directory="/opt/freeware/etc/" \ + --with-openssl \ + --disable-ipv6 \ + --enable-local-smux \ + --with-sys-location="Unknown" \ + --with-sys-contact="root@localhost" \ + --with-default-snmp-version="3" \ + --with-cflags="-Daix6=aix6 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -D_LARGE_FILES -qlonglong -q32 -I/usr/opt/perl5/lib/5.20.1/aix-thread-multi/CORE -I/opt/freeware/lib" \ + --libdir="/usr/opt/perl5/lib/5.20.1/aix-thread-multi/CORE" \ + --libdir="/opt/freeware/lib" \ + --mandir="/opt/freeware/man" + +#cp libtool libtool.orig +#sed -e "s/hardcode_direct=yes/hardcode_direct=no/" libtool.orig > libtool +chmod +x %{__find_requires} +env -i PATH=$PATH make -j8 %{?smp_mflags} + +%install +#export CC=cc_r +# ---------------------------------------------------------------------- +# 'install' sets the current directory to _topdir/BUILD/{name}-{version} +# ---------------------------------------------------------------------- +rm -rf $RPM_BUILD_ROOT + +env -i PATH=$PATH make -j8 DESTDIR=%{buildroot} install + +# Remove 'snmpinform' from the temporary directory because it is a +# symbolic link, which cannot be handled by the rpm installation process. +%__rm -f $RPM_BUILD_ROOT%{_prefix}/bin/snmpinform +# install the init script +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +perl -i -p -e 's@/usr/local/share/snmp/@/etc/snmp/@g;s@usr/local@%{_prefix}@g' dist/snmpd-init.d +/opt/freeware/bin/install -m 755 dist/snmpd-init.d $RPM_BUILD_ROOT/etc/rc.d/init.d/snmpd +cp local/mib2c.*.conf ${RPM_BUILD_ROOT}%{_datadir}/snmp + +cd perl +env -i PATH=$PATH make -j8 DESTDIR=%{_perl_dir} install +# remove special files +find $RPM_BUILD_ROOT -name perllocal.pod \ + -o -name .packlist \ + -o -name "*.bs" \ + -o -name Makefile.subs.pl \ + | xargs -i rm -f {} +cd .. + +# store a copy of installed Perl stuff. It's too complex to predict +find %{_perl_dir} -type f -name "*.a" \ + -o -name "*.so" \ + -o -name "*.la" | sed 's/^/\//' > net-snmp-perl-files + + +%post +# ---------------------------------------------------------------------- +# The 'post' script is executed just after the package is installed. +# ---------------------------------------------------------------------- +# Create the symbolic link 'snmpinform' after all other files have +# been installed. +%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform +%__ln_s $RPM_INSTALL_PREFIX/bin/snmptrap $RPM_INSTALL_PREFIX/bin/snmpinform + +if [ ! -f "$RPM_INSTALL_PREFIX/lib/libperl.a" ] +then +%__ln_s /usr/opt/perl5/lib/5.20.1/aix-thread-multi/CORE/libperl.a $RPM_INSTALL_PREFIX/lib/libperl.a +fi + +# run ldconfig +#PATH="$PATH:/sbin" ldconfig -n $RPM_INSTALL_PREFIX/lib + +%preun +# ---------------------------------------------------------------------- +# The 'preun' script is executed just before the package is erased. +# ---------------------------------------------------------------------- +# Remove the symbolic link 'snmpinform' before anything else, in case +# it is in a directory that rpm wants to remove (at present, it isn't). +%__rm -f $RPM_INSTALL_PREFIX/bin/snmpinform + +%postun +# ---------------------------------------------------------------------- +# The 'postun' script is executed just after the package is erased. +# ---------------------------------------------------------------------- + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) + +# Install the following documentation in _defaultdocdir/{name}-{version}/ +%doc AGENT.txt ChangeLog CodingStyle COPYING +%doc EXAMPLE.conf.def FAQ INSTALL NEWS PORTING TODO +%doc README README.agentx README.hpux11 README.krb5 +%doc README.snmpv3 README.solaris README.thread README.win32 +%doc README.aix README.osX README.tru64 README.irix README.agent-mibs +%doc README.Panasonic_AM3X.txt + +%{_datadir}/snmp + +%{_bindir} +%{_sbindir} +%{_mandir}/man1/* +# don't include Perl man pages, which start with caps +%{_mandir}/man3/[^A-Z]* +%{_mandir}/man5/* +%{_mandir}/man8/* +%{_libdir}/*.a +%{_libdir}/*.la +%{_libdir}/*.so* +/etc/rc.d/init.d/snmpd +%{_includedir} + +#%files -f net-snmp-perl-files devel +%files devel +%defattr(-,root,root) + +%files perl +%defattr(-,root,root) +%{_bindir}/mib2c +%{_bindir}/tkmib +%{_perl_dir}/lib/site_perl/5.20.1/aix-thread-multi/* +%attr(0644,root,root) %{_mandir}/man1/mib2c.1 +%attr(0644,root,root) %{_mandir}/man1/tkmib.1 +%attr(0644,root,root) %{_perl_dir}/man/man3/*SNMP*.3 + + +%verifyscript +echo "No additional verification is done for net-snmp" + +%changelog +* Tue Jan 12 2016 Jan GONG Jie +- Clear environment variables while make is running + +* Wed Jan 6 2016 Jan GONG Jie +- Upgrade to net-snmp 5.7.3 +- Rebuild on AIX 7.2 + +* Tue May 6 2008 Jan Safranek +- remove %{libcurrent} +- don't use Provides: unless necessary, let rpmbuild compute the provided + libraries + +* Tue Jun 30 2007 Thomas Anders +- add "BuildRequires: perl-ExtUtils-Embed", e.g. for Fedora 7 +- add --enable-as-needed if building with embedded Perl support +* Wed Nov 23 2006 Thomas Anders +- fixes for 5.4 and 64-bit platforms +- enable Perl by default, but allow for --without perl_modules|embedded_perl +- add netsnmp_ prefix for local defines + +* Fri Sep 1 2006 Thomas Anders +- Update to 5.4.dev +- introduce %{libcurrent} +- use new disman/event name +- add: README.aix README.osX README.tru64 README.irix README.agent-mibs + README.Panasonic_AM3X.txt +- add new NetSNMP::agent::Support + +* Fri Jan 13 2006 hardaker +- Update to 5.3.0.1 + +* Wed Dec 28 2005 hardaker +- Update to 5.3 + +* Tue Oct 28 2003 rs +- fix conditional perl build after reading rpm docs + +* Sat Oct 4 2003 rs - 5.0.9-4 +- fix to build without requiring arguments +- separate embedded perl and perl modules options +- fix fix for init.d script for non-/usr/local installation + +* Fri Sep 26 2003 Wes Hardaker +- fix perl's UseNumeric +- fix init.d script for non-/usr/local installation + +* Fri Sep 12 2003 Wes Hardaker +- fixes for 5.0.9's perl support + +* Mon Sep 01 2003 Wes Hardaker +- added perl support + +* Wed Oct 09 2002 Wes Hardaker +- Incorperated most of Mark Harig's better version of the rpm spec and Makefile + +* Wed Oct 09 2002 Wes Hardaker +- Made it possibly almost usable. + +* Mon Apr 22 2002 Robert Story +- created