[709] | 1 | %define svn_url http://svn.netlabs.org/repos/ports/sdl_net/trunk
|
---|
| 2 | %define svn_rev 1414
|
---|
| 3 |
|
---|
| 4 | %define name sdl_net
|
---|
| 5 | %define version 1.2.8
|
---|
| 6 | %define release 1
|
---|
| 7 |
|
---|
| 8 | Summary: SDL portable network library
|
---|
| 9 | Name: %{name}
|
---|
| 10 | Version: %{version}
|
---|
| 11 | Release: %{release}%{?dist}
|
---|
| 12 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
|
---|
| 13 | Patch0: sdl_net-os2.patch
|
---|
| 14 | URL: http://www.libsdl.org/projects/SDL_net/
|
---|
| 15 | License: LGPL
|
---|
| 16 | Group: System Environment/Libraries
|
---|
| 17 | BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
---|
| 18 | Prefix: %{_prefix}
|
---|
| 19 | Requires: sdl
|
---|
| 20 |
|
---|
| 21 | %description
|
---|
| 22 | This is a portable network library for use with SDL.
|
---|
| 23 |
|
---|
| 24 | %package devel
|
---|
| 25 | Summary: Libraries and includes to develop SDL networked applications.
|
---|
| 26 | Group: Development/Libraries
|
---|
| 27 | Requires: %{name} = %{version}-%{release}
|
---|
| 28 |
|
---|
| 29 | %description devel
|
---|
| 30 | This is a portable network library for use with SDL.
|
---|
| 31 |
|
---|
| 32 | This is the libraries and include files you can use to develop SDL networked applications.
|
---|
| 33 |
|
---|
| 34 | %debug_package
|
---|
| 35 |
|
---|
| 36 | %prep
|
---|
| 37 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
|
---|
| 38 | %setup -q
|
---|
| 39 | %else
|
---|
| 40 | %setup -q -n "%{name}-%{version}" -Tc
|
---|
| 41 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
|
---|
| 42 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
|
---|
| 43 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
|
---|
| 44 | %endif
|
---|
| 45 |
|
---|
| 46 | #%patch0 -p1
|
---|
| 47 |
|
---|
| 48 | libtoolize -fci
|
---|
| 49 | ./autogen.sh
|
---|
| 50 |
|
---|
| 51 | %build
|
---|
| 52 | export CFLAGS="-g -DBUILD_SDL" LDFLAGS="-g -Zhigh-mem"
|
---|
| 53 |
|
---|
| 54 | %configure \
|
---|
| 55 | --prefix=%{prefix} \
|
---|
| 56 | --disable-gui \
|
---|
| 57 | --disable-static
|
---|
| 58 |
|
---|
| 59 | %{__make} %{?_smp_mflags}
|
---|
| 60 |
|
---|
| 61 | %install
|
---|
| 62 | rm -rf $RPM_BUILD_ROOT
|
---|
| 63 | %makeinstall
|
---|
| 64 |
|
---|
| 65 | # create import libs
|
---|
| 66 | emximp -o %{buildroot}%{_libdir}/SDL_net_dll.lib %{buildroot}%{_libdir}/SDL_n120.dll
|
---|
| 67 | emximp -o %{buildroot}%{_libdir}/SDL_net120_dll.lib %{buildroot}%{_libdir}/SDL_n120.dll
|
---|
| 68 | emximp -o %{buildroot}%{_libdir}/SDL_net_dll.a %{buildroot}%{_libdir}/SDL_n120.dll
|
---|
| 69 | emximp -o %{buildroot}%{_libdir}/SDL_net120_dll.a %{buildroot}%{_libdir}/SDL_n120.dll
|
---|
| 70 |
|
---|
| 71 | # create forwarder
|
---|
| 72 | cat << EOF >%{buildroot}%{_libdir}/sdlnet.def
|
---|
| 73 | LIBRARY SDLnet
|
---|
| 74 | DESCRIPTION '@#libsdl org:1.2.15#@##1## 2016-03-16 dtp::::::@@SDL_net (alternative port) forwarder'
|
---|
| 75 | IMPORTS
|
---|
| 76 | SDLNet_Linked_Version=SDL_n120.SDLNet_Linked_Version
|
---|
| 77 | SDLNet_Init=SDL_n120.SDLNet_Init
|
---|
| 78 | SDLNet_Quit=SDL_n120.SDLNet_Quit
|
---|
| 79 | SDLNet_ResolveHost=SDL_n120.SDLNet_ResolveHost
|
---|
| 80 | SDLNet_ResolveIP=SDL_n120.SDLNet_ResolveIP
|
---|
| 81 | SDLNet_GetLocalAddresses=SDL_n120.SDLNet_GetLocalAddresses
|
---|
| 82 | SDLNet_Write16=SDL_n120.SDLNet_Write16
|
---|
| 83 | SDLNet_Write32=SDL_n120.SDLNet_Write32
|
---|
| 84 | SDLNet_Read16=SDL_n120.SDLNet_Read16
|
---|
| 85 | SDLNet_Read32=SDL_n120.SDLNet_Read32
|
---|
| 86 | SDLNet_AllocSocketSet=SDL_n120.SDLNet_AllocSocketSet
|
---|
| 87 | SDLNet_AddSocket=SDL_n120.SDLNet_AddSocket
|
---|
| 88 | SDLNet_DelSocket=SDL_n120.SDLNet_DelSocket
|
---|
| 89 | SDLNet_CheckSockets=SDL_n120.SDLNet_CheckSockets
|
---|
| 90 | SDLNet_FreeSocketSet=SDL_n120.SDLNet_FreeSocketSet
|
---|
| 91 | SDLNet_TCP_Open=SDL_n120.SDLNet_TCP_Open
|
---|
| 92 | SDLNet_TCP_Accept=SDL_n120.SDLNet_TCP_Accept
|
---|
| 93 | SDLNet_TCP_GetPeerAddress=SDL_n120.SDLNet_TCP_GetPeerAddress
|
---|
| 94 | SDLNet_TCP_Send=SDL_n120.SDLNet_TCP_Send
|
---|
| 95 | SDLNet_TCP_Recv=SDL_n120.SDLNet_TCP_Recv
|
---|
| 96 | SDLNet_TCP_Close=SDL_n120.SDLNet_TCP_Close
|
---|
| 97 | SDLNet_AllocPacket=SDL_n120.SDLNet_AllocPacket
|
---|
| 98 | SDLNet_ResizePacket=SDL_n120.SDLNet_ResizePacket
|
---|
| 99 | SDLNet_FreePacket=SDL_n120.SDLNet_FreePacket
|
---|
| 100 | SDLNet_AllocPacketV=SDL_n120.SDLNet_AllocPacketV
|
---|
| 101 | SDLNet_FreePacketV=SDL_n120.SDLNet_FreePacketV
|
---|
| 102 | SDLNet_UDP_Open=SDL_n120.SDLNet_UDP_Open
|
---|
| 103 | SDLNet_UDP_SetPacketLoss=SDL_n120.SDLNet_UDP_SetPacketLoss
|
---|
| 104 | SDLNet_UDP_Bind=SDL_n120.SDLNet_UDP_Bind
|
---|
| 105 | SDLNet_UDP_Unbind=SDL_n120.SDLNet_UDP_Unbind
|
---|
| 106 | SDLNet_UDP_GetPeerAddress=SDL_n120.SDLNet_UDP_GetPeerAddress
|
---|
| 107 | SDLNet_UDP_SendV=SDL_n120.SDLNet_UDP_SendV
|
---|
| 108 | SDLNet_UDP_Send=SDL_n120.SDLNet_UDP_Send
|
---|
| 109 | SDLNet_UDP_RecvV=SDL_n120.SDLNet_UDP_RecvV
|
---|
| 110 | SDLNet_UDP_Recv=SDL_n120.SDLNet_UDP_Recv
|
---|
| 111 | SDLNet_UDP_Close=SDL_n120.SDLNet_UDP_Close
|
---|
| 112 | EXPORTS
|
---|
| 113 | SDLNet_Linked_Version @1
|
---|
| 114 | SDLNet_Init @2
|
---|
| 115 | SDLNet_Quit @3
|
---|
| 116 | SDLNet_ResolveHost @4
|
---|
| 117 | SDLNet_ResolveIP @5
|
---|
| 118 | SDLNet_GetLocalAddresses @6
|
---|
| 119 | SDLNet_Write16 @7
|
---|
| 120 | SDLNet_Write32 @8
|
---|
| 121 | SDLNet_Read16 @9
|
---|
| 122 | SDLNet_Read32 @10
|
---|
| 123 | SDLNet_AllocSocketSet @11
|
---|
| 124 | SDLNet_AddSocket @12
|
---|
| 125 | SDLNet_DelSocket @13
|
---|
| 126 | SDLNet_CheckSockets @14
|
---|
| 127 | SDLNet_FreeSocketSet @15
|
---|
| 128 | SDLNet_TCP_Open @16
|
---|
| 129 | SDLNet_TCP_Accept @17
|
---|
| 130 | SDLNet_TCP_GetPeerAddress @18
|
---|
| 131 | SDLNet_TCP_Send @19
|
---|
| 132 | SDLNet_TCP_Recv @20
|
---|
| 133 | SDLNet_TCP_Close @21
|
---|
| 134 | SDLNet_AllocPacket @22
|
---|
| 135 | SDLNet_ResizePacket @23
|
---|
| 136 | SDLNet_FreePacket @24
|
---|
| 137 | SDLNet_AllocPacketV @25
|
---|
| 138 | SDLNet_FreePacketV @26
|
---|
| 139 | SDLNet_UDP_Open @27
|
---|
| 140 | SDLNet_UDP_SetPacketLoss @28
|
---|
| 141 | SDLNet_UDP_Bind @29
|
---|
| 142 | SDLNet_UDP_Unbind @30
|
---|
| 143 | SDLNet_UDP_GetPeerAddress @31
|
---|
| 144 | SDLNet_UDP_SendV @32
|
---|
| 145 | SDLNet_UDP_Send @33
|
---|
| 146 | SDLNet_UDP_RecvV @34
|
---|
| 147 | SDLNet_UDP_Recv @35
|
---|
| 148 | SDLNet_UDP_Close @36
|
---|
| 149 | EOF
|
---|
| 150 | echo "">%{buildroot}%{_libdir}/dummy.c
|
---|
| 151 | gcc -Zomf -o %{buildroot}%{_libdir}/dummy.o -c %{buildroot}%{_libdir}/dummy.c
|
---|
| 152 | gcc -Zomf -Zdll -o %{buildroot}%{_libdir}/SDLnet.dll \
|
---|
| 153 | %{buildroot}%{_libdir}/sdlnet.def %{buildroot}%{_libdir}/dummy.o
|
---|
| 154 | rm -rf %{buildroot}%{_libdir}/dummy.* %{buildroot}%{_libdir}/sdlnet.def
|
---|
| 155 |
|
---|
| 156 | %clean
|
---|
| 157 | rm -rf $RPM_BUILD_ROOT
|
---|
| 158 |
|
---|
| 159 | %files
|
---|
| 160 | %defattr(-,root,root)
|
---|
| 161 | %doc README CHANGES COPYING
|
---|
| 162 | %{prefix}/lib/SDL*.dll
|
---|
| 163 |
|
---|
| 164 | %files devel
|
---|
| 165 | %defattr(-,root,root)
|
---|
| 166 | %doc README CHANGES COPYING
|
---|
| 167 | %{prefix}/lib/SDL*.a
|
---|
| 168 | %exclude %{prefix}/lib/lib*.la*
|
---|
| 169 | %{prefix}/lib/SDL*.lib
|
---|
| 170 | %{prefix}/include/SDL/
|
---|
| 171 | %{prefix}/lib/pkgconfig/*.pc
|
---|
| 172 |
|
---|
| 173 | %changelog
|
---|
| 174 | * Tue Mar 15 2016 Valery V.Sedletski <_valerius@mail.ru> - 1.2.8-1
|
---|
| 175 | - Initial OS/2 packaging
|
---|