Guest User

Untitled

a guest
Jan 16th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.96 KB | None | 0 0
  1. #!/usr/bin/make -f
  2.  
  3. DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  4. DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
  5. DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  6. DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
  7. VERSION = $(shell dpkg-parsechangelog|sed -n 's/^Version: //p')
  8. DEBIAN_VERSION = $(shell echo $(VERSION)|sed -nr 's/[^:]+://; s/.*-([^-]+$$)/\1/p')
  9.  
  10. ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
  11. confflags := --build=$(DEB_BUILD_GNU_TYPE)
  12. else
  13. confflags := --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
  14. endif
  15.  
  16. ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
  17. confflags += --enable-debug
  18. endif
  19.  
  20. ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
  21. confflags += --disable-optimizations --disable-mmx --disable-sse --disable-altivec
  22. endif
  23.  
  24. # configure flags
  25. confflags += \
  26.     CFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
  27.     CPPFLAGS="$(shell dpkg-buildflags --get CPPFLAGS)" \
  28.     CXXFLAGS="$(shell dpkg-buildflags --get CXXFLAGS)" \
  29.     LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)" \
  30.     --config-cache \
  31.     --disable-maintainer-mode \
  32.     --disable-silent-rules \
  33.     --disable-update-check \
  34.     --enable-fast-install \
  35.     --prefix=/usr \
  36.     --docdir=/usr/share/doc/vlc-nox \
  37.     --sysconfdir=/etc \
  38.     --with-binary-version=$(DEBIAN_VERSION) \
  39.     $(NULL)
  40. # configure features
  41. confflags += \
  42.     --enable-a52 \
  43.     --enable-aa \
  44.     --enable-bluray \
  45.     --enable-bonjour \
  46.     --enable-caca \
  47.     --enable-dbus \
  48.     --enable-dca \
  49.     --enable-dirac \
  50.     --enable-dvbpsi \
  51.     --enable-dvdnav \
  52.     --enable-faad \
  53.     --enable-flac \
  54.     --enable-fluidsynth \
  55.     --enable-freetype \
  56.     --enable-fribidi \
  57.     --enable-gnutls \
  58.     --enable-jack \
  59.     --enable-kate \
  60.     --enable-libass \
  61.     --enable-libmpeg2 \
  62.     --enable-libproxy \
  63.     --enable-libxml2 \
  64.     --enable-lirc \
  65.     --enable-live555 \
  66.     --enable-mad \
  67.     --enable-mkv \
  68.     --enable-mod \
  69.     --enable-mpc \
  70.     --enable-mtp \
  71.     --enable-mux_ogg \
  72.     --enable-ncurses \
  73.     --enable-notify \
  74.     --enable-ogg \
  75.     --enable-oss \
  76.     --enable-pulse \
  77.     --enable-qt4 \
  78.     --enable-realrtsp \
  79.     --enable-samplerate \
  80.     --enable-schroedinger \
  81.     --enable-sdl \
  82.     --enable-shout \
  83.     --enable-skins2 \
  84.     --enable-smb \
  85.     --enable-speex \
  86.     --enable-svg \
  87.     --enable-taglib \
  88.     --enable-theora \
  89.     --enable-twolame \
  90.     --enable-upnp \
  91.     --enable-vcd \
  92.     --enable-vcdx \
  93.     --enable-vorbis \
  94.     --enable-x264 \
  95.     --enable-zvbi \
  96.     --with-kde-solid=/usr/share/kde4/apps/solid/actions/ \
  97.     $(NULL)
  98. # Reasons for disabling features:
  99. # dxva2 -> Windows only
  100. # gnomevfs -> poorly maintained
  101. # goom -> not in Debian
  102. # portaudio -> not needed
  103. # projectm -> broken
  104. # sqlite -> still in development
  105. # telx -> incompatible with zvbi
  106. confflags += \
  107.     --disable-dxva2 \
  108.     --disable-gnomevfs \
  109.     --disable-goom \
  110.     --disable-portaudio \
  111.     --disable-projectm \
  112.     --disable-sqlite \
  113.     --disable-telx \
  114.     $(NULL)
  115.  
  116. # Linux specific flags
  117. ifeq ($(DEB_HOST_ARCH_OS),linux)
  118. confflags += \
  119.     --enable-alsa \
  120.     --enable-atmo \
  121.     --enable-dc1394 \
  122.     --enable-dv \
  123.     --enable-libva \
  124.     --enable-linsys \
  125.     --enable-pvr \
  126.     --enable-udev \
  127.     --enable-v4l2 \
  128.     $(NULL)
  129. endif
  130.  
  131. ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
  132. confflags += \
  133.     --disable-alsa \
  134.     --enable-v4l2 \
  135.     $(NULL)
  136. endif
  137.  
  138. %:
  139.     dh $@ --parallel --with autoreconf
  140.  
  141. override_dh_autoreconf:
  142.     dh_autoreconf --as-needed
  143.  
  144. override_dh_auto_clean:
  145.     [ ! -f debian/vlc-nox.install.bak ] || mv -f debian/vlc-nox.install.bak \
  146.         debian/vlc-nox.install
  147.     rm -f debian/vlc-nox.install.kfreebsd
  148.     rm -f debian/vlc-nox.install.hurd
  149.     rm -rf tmp/
  150.     dh_auto_clean
  151.  
  152. override_dh_auto_configure:
  153.     # We need to build the static library apart
  154.     # Else it's a mess when we build the modules
  155.     ./configure --enable-static $(confflags)
  156.     $(MAKE) -C compat
  157.     $(MAKE) -C src libvlccore.la
  158.     $(MAKE) -C lib libvlc.la
  159.     mkdir -p tmp
  160.     cp src/.libs/libvlccore.a tmp/libvlccore.a
  161.     cp lib/.libs/libvlc.a tmp/libvlc.a
  162.     dh_auto_configure -- $(confflags)
  163.  
  164. override_dh_auto_test:
  165. ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
  166. ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  167.     # Check which plugins were built and whether they load properly.
  168.     @if test $$( id -u ) -eq 0 ; then \
  169.        echo "Not runing the test as you are compiling as root"; \
  170.        echo "Use 'dpkg-buildpackage -rfakeroot' rather than 'fakeroot dpkg-buildpackage'"; \
  171.     else \
  172.        command="./vlc -vvv --ignore-config --no-plugins-cache --list --no-color"; \
  173.        echo "$${command}"; $${command} ; \
  174.     fi
  175. endif
  176. endif
  177.  
  178. override_dh_install:
  179.     cp debian/vlc-nox.install debian/vlc-nox.install.bak
  180.     for dir in sse2 3dnow altivec arm_neon mmx mmxext ; do \
  181.             if test -d debian/tmp/usr/lib/vlc/plugins/$${dir}; then \
  182.                     echo usr/lib/vlc/plugins/$${dir} >> debian/vlc-nox.install ; \
  183.             fi ; \
  184.     done
  185.     # Remove some modules on non-linux arch
  186.     sed -e '/\(lib\|libaccess_\)\(alsa\|atmo\|dc1394\|dtv\|dv\|fb\|pvr\|udev\)_/d;/liblinsys_/d' \
  187.      debian/vlc-nox.install > debian/vlc-nox.install.kfreebsd
  188.     sed -e '/\(lib\|libaccess_\)v4l2_/d' \
  189.      debian/vlc-nox.install.kfreebsd > debian/vlc-nox.install.hurd
  190.     cp tmp/libvlc.a debian/tmp/usr/lib
  191.     cp tmp/libvlccore.a debian/tmp/usr/lib
  192.     # Clean up libtool crap
  193.     find debian/tmp -name '*.la' -delete
  194.     # Remove useless stuff
  195.     ln -sf /usr/share/fonts/truetype/freefont/FreeSans.ttf debian/tmp/usr/share/vlc/skins2/fonts/FreeSans.ttf
  196.     ln -sf /usr/share/fonts/truetype/freefont/FreeMonoBold.ttf debian/tmp/usr/share/vlc/skins2/fonts/FreeSansBold.ttf
  197.     rm -f debian/tmp/usr/share/man/man1/vlc-config.1
  198.     # Remove additional license files
  199.     find debian/tmp -name LICENSE -delete
  200.     # Install stuff
  201.     dh_install --fail-missing
  202.     # move .hosts
  203.     if test -d debian/vlc-data; then \
  204.         mkdir -p debian/vlc-data/etc/vlc/lua/http/dialogs && \
  205.         mv debian/vlc-data/usr/share/vlc/lua/http/dialogs/.hosts debian/vlc-data/etc/vlc/lua/http/dialogs && \
  206.         ln -s /etc/vlc/lua/http/dialogs/.hosts debian/vlc-data/usr/share/vlc/lua/http/dialogs/.hosts && \
  207.         mv debian/vlc-data/usr/share/vlc/lua/http/.hosts debian/vlc-data/etc/vlc/lua/http && \
  208.         ln -s /etc/vlc/lua/http/.hosts debian/vlc-data/usr/share/vlc/lua/http/.hosts; \
  209.     fi
  210. ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  211.     # Check that we did not install a plugin linked with libX11 or
  212.     # libxcb in vlc-nox
  213.     BORKED=no; \
  214.     for file in $$(find debian/vlc-nox/usr/lib/vlc -name '*.so'); do \
  215.       if objdump -x $$file | egrep -q -e '^ +NEEDED +libX11\.so' \
  216.                                       -e '^ +NEEDED +libxcb\.so'; then \
  217.         BORKED=yes; \
  218.         echo $$file depends on libX11 or libxcb; \
  219.       fi; \
  220.     done; \
  221.     if test "$$BORKED" = yes; then exit 1; fi
  222. endif
  223.     $(if $(shell dpkg-vendor --is Ubuntu && echo true),dh_install -pvlc-nox debian/source_vlc.py usr/share/apport/package-hooks/)
  224.     dh_buildinfo -p vlc-nox
  225.  
  226. override_dh_strip:
  227.     dh_strip --dbg-package=vlc-dbg
  228.  
  229. override_dh_installdocs:
  230.     dh_installdocs -p vlc-data
  231.     dh_installdocs -p vlc-nox
  232.  
  233. override_dh_installchangelogs:
  234.     dh_installchangelogs ChangeLog -p vlc-data
  235.     dh_installchangelogs ChangeLog -p vlc-nox
Add Comment
Please, Sign In to add comment