Hello Niels,

On Sun, Apr 16, 2017 at 12:36:00PM +0000, Niels Thykier wrote: 
> It is probably a lot easier for us to judge this given a source debdiff
> of the actual changes (or two, one for the symlinks and one for the
> upstream release).  Could you perhaps provide such debdiff?

of course I can. The upstream changes are a bit to big adding them here and
they are not that useful I think. So I drop them here.

Upstream has added a new documentation for Indonesian, I added that as a new
package but disabled it for now, it's not that big and needs to go through NEW
later. Just added to not forget it later.

My current WIP specific to the debian/ folder looks like this:

t a/debian/changelog b/debian/changelog
index 76a10e38..5063ad23 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,28 @@
+kicad (4.0.6+dfsg1-1~1.gbpa34244) UNRELEASED; urgency=medium
+
+  ** SNAPSHOT build @a342449ec6428e76587cc655786b8cf45501e14c **
+
+  * [2186d4d] debian/rules: make dh_fixperms arch-depended (again)
+  * [bc1607f] idf2vrml.1: fix syntax of the hyphen for option '-k'
+  * [6fce2c4] update footprint libraries for component tarball
+  * [e732ddb] New upstream version 4.0.6+dfsg1
+  * [aa82369] rebuild patch queue from patch-queue branch
+  * [5ef5ad6] debian/control: update B-D after upstream changes
+  * [668aca6] adding new -doc package with Indonesian i18n
+  * [b793a0f] kicad-common.README.Debian: adding Debian specific remarks
+  * [5f85335] debian/rules: set permissions for *.kicad_mod files
+  * [a342449] kicad-common: symlink renamed footprint libraries
+
+ -- Carsten Schoenert <c.schoen...@t-online.de>  Sat, 15 Apr 2017 19:02:10 
+0200
+
 kicad (4.0.5+dfsg1-4) unstable; urgency=medium
 
   [ Carsten Schoenert ]
   * [375ce2f] Revert "debian/control: decrease Architectures for arch packages"
     + removing the arch specific decrease of the build architecture, it's
       really not useful here (Thx Emilio & Aurelien)
-  * [b2c400d] kicad-common.lintian-overrides: ingoring Lintian
-    + kicad-common is now arch dependend, silence lintian here that is saying
+  * [b2c400d] kicad-common.lintian-overrides: ignoring Lintian
+    + kicad-common is now arch dependent, silence lintian here that is saying
       kicad-common has only content that is indep but we relay on the python
       package
 
diff --git a/debian/control b/debian/control
index 5d43e733..72f4f8cf 100644
--- a/debian/control
+++ b/debian/control
@@ -32,10 +32,11 @@ Build-Depends:
  libboost-thread-dev,
  libbz2-dev,
  libcairo2-dev,
- libcurl4-gnutls-dev,
+ libcurl4-openssl-dev,
  libglew-dev,
  liblocale-gettext-perl,
  libpython-stdlib,
+ libssl-dev,
  libterm-readkey-perl,
  libtext-wrapi18n-perl,
  libunicode-linebreak-perl,
@@ -59,6 +60,7 @@ Build-Depends:
  texlive-lang-german,
  texlive-lang-italian,
  texlive-lang-japanese,
+ texlive-lang-other,
  texlive-lang-polish,
  texlive-lang-spanish,
  texlive-xetex,
@@ -206,6 +208,18 @@ Description: Kicad help files (French)
   * Pcbnew - The printed circuit board software tool
   * PlEditor - The layout editor for custom title block
 
+#Package: kicad-doc-id
+#Section: doc
+#Architecture: all
+#Multi-Arch: foreign
+#Depends:
+# ${misc:Depends},
+#Description: Kicad help files (Indonesian)
+# This package provides various documentation files for KiCad in Indonesian, 
like
+# the EPUB and the PDF files and also the OnLine HTML documentation for:
+# .
+#  * GSIK - Getting Started in KiCad
+
 Package: kicad-doc-it
 Section: doc
 Architecture: all
diff --git a/debian/create_kicad_upstream_tarballs.sh 
b/debian/create_kicad_upstream_tarballs.sh
index b72da2ef..2f4fbf31 100755
--- a/debian/create_kicad_upstream_tarballs.sh
+++ b/debian/create_kicad_upstream_tarballs.sh
@@ -356,61 +356,80 @@ echo
 # collecting and preparing data for the KiCad libraries tarball #
 #################################################################
 
-# The various component, footprint and 3D-model libraries are available one
+# The various component-, footprint- and 3D-model libraries are available on
 # GitHub in various repositories. Uncomment the following two lines to get
-# a dynamically created list of repositories. Otherwise it's currently better
-# to use the static list as some repositories currently empty like:
+# a dynamically created list of repositories. We can keep the upstream provided
+# libararies even if there are some repositories currently empty like:
 # Connectors_Amphenol.pretty
+# Enclosures.pretty
+# Housings_LCC.pretty
+# Housings_PGA.pretty
+# If we don't want to include empty repositories we need to also adjust the
+# default fp-lib-table in 
libraries/kicad-library/template/fp-lib-table.for-pretty !
 
-#PRETTY_REPOS=$(curl https://api.github.com/orgs/KiCad/repos?per_page=2000 2> 
/dev/null | sed -r 's:.+ "full_name".*"KiCad/(.+\.pretty)",:\1:p;d')
-#PRETTY_REPOS=$(echo $PRETTY_REPOS | tr " " "\n" | sort)
+#PRETTY_REPOS1=$(curl -s 
"https://api.github.com/orgs/KiCad/repos?per_page=100&page=1"; 
"https://api.github.com/orgs/KiCad/repos?per_page=100&page=2"; 2> /dev/null |\
+#sed -r 's:.+ "full_name".*"KiCad/(.+\.pretty)",:\1:p;d' | tr " " "\n" | sort)
 
 PRETTY_REPOS="\
 Air_Coils_SML_NEOSID.pretty
 Battery_Holders.pretty
 Buttons_Switches_SMD.pretty
-Buttons_Switches_ThroughHole.pretty
+Buttons_Switches_THT.pretty
 Buzzers_Beepers.pretty
 Capacitors_SMD.pretty
 Capacitors_Tantalum_SMD.pretty
-Capacitors_ThroughHole.pretty
+Capacitors_THT.pretty
 Choke_Axial_ThroughHole.pretty
 Choke_Common-Mode_Wurth.pretty
 Choke_Radial_ThroughHole.pretty
 Choke_SMD.pretty
 Choke_Toroid_ThroughHole.pretty
+Connectors_Amphenol.pretty
 Connectors_Harwin.pretty
 Connectors_Hirose.pretty
 Connectors_JAE.pretty
 Connectors_JST.pretty
+Connectors_Mini-Universal.pretty
 Connectors_Molex.pretty
 Connectors_Multicomp.pretty
 Connectors_Phoenix.pretty
+Connectors.pretty
 Connectors_Samtec.pretty
 Connectors_TE-Connectivity.pretty
-Connect.pretty
+Connectors_Terminal_Blocks.pretty
+Connectors_USB.pretty
+Connectors_WAGO.pretty
 Converters_DCDC_ACDC.pretty
 Crystals.pretty
 Diodes_SMD.pretty
-Diodes_ThroughHole.pretty
+Diodes_THT.pretty
 Discret.pretty
-Display.pretty
 Displays_7-Segment.pretty
+Displays.pretty
 Divers.pretty
+Enclosures.pretty
 EuroBoard_Outline.pretty
 Fiducials.pretty
 Filters_HF_Coils_NEOSID.pretty
 Fuse_Holders_and_Fuses.pretty
 Hall-Effect_Transducers_LEM.pretty
 Heatsinks.pretty
+Housings_BGA.pretty
+Housings_CSP.pretty
 Housings_DFN_QFN.pretty
 Housings_DIP.pretty
+Housings_LCC.pretty
+Housings_LGA.pretty
+Housings_PGA.pretty
 Housings_QFP.pretty
 Housings_SIP.pretty
 Housings_SOIC.pretty
+Housings_SON.pretty
 Housings_SSOP.pretty
 Inductors_NEOSID.pretty
 Inductors.pretty
+Inductors_SMD.pretty
+Inductors_THT.pretty
 IR-DirectFETs.pretty
 Labels.pretty
 LEDs.pretty
@@ -418,6 +437,7 @@ Measurement_Points.pretty
 Measurement_Scales.pretty
 Mechanical_Sockets.pretty
 Microwave.pretty
+Modules.pretty
 Mounting_Holes.pretty
 NF-Transformers_ETAL.pretty
 Oddities.pretty
@@ -427,25 +447,23 @@ PFF_PSF_PSS_Leadforms.pretty
 Pin_Headers.pretty
 Potentiometers.pretty
 Power_Integrations.pretty
-Relays_ThroughHole.pretty
+Relays_THT.pretty
 Resistors_SMD.pretty
-Resistors_ThroughHole.pretty
+Resistors_THT.pretty
 Resistors_Universal.pretty
 RF_Modules.pretty
 Shielding_Cabinets.pretty
 SMD_Packages.pretty
-Sockets_BNC.pretty
-Sockets_Mini-Universal.pretty
 Sockets_MOLEX_KK-System.pretty
 Sockets.pretty
 Socket_Strips.pretty
-Sockets_WAGO734.pretty
 Symbols.pretty
-Terminal_Blocks.pretty
 TO_SOT_Packages_SMD.pretty
 TO_SOT_Packages_THT.pretty
 Transformers_CHK.pretty
+Transformers_SMD.pretty
 Transformers_SMPS_ThroughHole.pretty
+Transformers_THT.pretty
 Transistors_OldSowjetAera.pretty
 Valves.pretty
 Varistors.pretty
diff --git a/debian/gbp.conf b/debian/gbp.conf
index 1ba29ac8..f66c1ced 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -16,6 +16,6 @@ debian-branch = debian/sid
 
 [import-orig]
 # filter out unwanted files/dirs from upstream
-filter = [ '.bzrignore', '*.gitignore', ]
+filter = [ '.bzrignore', '*.gitignore', '.travis.yml', ]
 # filter the files out of the tarball passed to pristine-tar
 filter-pristine-tar = True
diff --git a/debian/kicad-common.README.Debian 
b/debian/kicad-common.README.Debian
new file mode 100644
index 00000000..f3bd031a
--- /dev/null
+++ b/debian/kicad-common.README.Debian
@@ -0,0 +1,37 @@
+# Changed footprint libraries between KiCad 4.0.4 and 4.0.5 #
+
+Upstream has changed some footprint libraries on top of the version 4.0.5. The
+libraries that got renamed are symlinked by the old names to the recent changed
+library.
+
+Renamed libraries:
+    Buttons_Switches_ThroughHole.pretty -> Buttons_Switches_THT.pretty
+    Capacitors_ThroughHole.pretty       -> Capacitors_THT.pretty
+    Connect.pretty                      -> Connectors.pretty
+    Display.pretty                      -> Displays.pretty
+    Diodes_ThroughHole.pretty           -> Diodes_THT.pretty
+    Relays_ThroughHole.pretty           -> Relays_THT.pretty
+    Resistors_ThroughHole.pretty        -> Resistors_THT.pretty
+    Sockets_BNC.pretty                  -> Connectors_TE-Connectivity.pretty
+    Sockets_Mini-Universal.pretty       -> Connectors_Mini-Universal.pretty
+    Terminal_Blocks.pretty              -> Connectors_Terminal_Blocks.pretty
+
+# Changed footprint libraries between KiCad 4.0.5 and 4.0.6 #
+
+Upstream added some new footprint libraries on top of the version 4.0.6. You
+likely need to adust library settings if needed.
+This upstream change is in preparation for removing some other older libraries.
+
+Those libraries were added:
+    Enclosures.pretty (currently empty)
+    Housings_BGA.pretty
+    Housings_LCC.pretty (currently empty)
+    Housings_LGA.pretty
+    Housings_PGA.pretty (currently empty)
+    Inductors_SMD.pretty
+    Inductors_THT.pretty
+    Modules.pretty
+    Transformers_SMD.pretty
+    Transformers_THT.pretty
+
+ -- Carsten Schoenert <c.schoen...@t-online.de>  Sun, 22 Mar 2017 22:12:00 
+0100
diff --git a/debian/kicad-common.links b/debian/kicad-common.links
index 18314f37..c67c817d 100644
--- a/debian/kicad-common.links
+++ b/debian/kicad-common.links
@@ -1,2 +1,15 @@
 # source                                          # target
 usr/share/kicad/template/fp-lib-table.for-pretty  
usr/share/kicad/template/fp-lib-table
+
+# Renamed footprints in 4.0.5
+# source (new footprint)                                   # target (old 
footprint)
+usr/share/kicad/modules/Buttons_Switches_THT.pretty        
usr/share/kicad/modules/Buttons_Switches_ThroughHole.pretty
+usr/share/kicad/modules/Capacitors_THT.pretty              
usr/share/kicad/modules/Capacitors_ThroughHole.pretty
+usr/share/kicad/modules/Connectors.pretty                  
usr/share/kicad/modules/Connect.pretty
+usr/share/kicad/modules/Displays.pretty                    
usr/share/kicad/modules/Display.pretty
+usr/share/kicad/modules/Diodes_THT.pretty                  
usr/share/kicad/modules/Diodes_ThroughHole.pretty
+usr/share/kicad/modules/Relays_THT.pretty                  
usr/share/kicad/modules/Relays_ThroughHole.pretty
+usr/share/kicad/modules/Resistors_THT.pretty               
usr/share/kicad/modules/Resistors_ThroughHole.pretty
+usr/share/kicad/modules/Connectors_TE-Connectivity.pretty  
usr/share/kicad/modules/Sockets_BNC.pretty
+usr/share/kicad/modules/Connectors_Mini-Universal.pretty   
usr/share/kicad/modules/Sockets_Mini-Universal.pretty
+usr/share/kicad/modules/Connectors_Terminal_Blocks.pretty  
usr/share/kicad/modules/Terminal_Blocks.pretty
diff --git a/debian/kicad-doc-id.doc-base b/debian/kicad-doc-id.doc-base
new file mode 100644
index 00000000..97f26cb1
--- /dev/null
+++ b/debian/kicad-doc-id.doc-base
@@ -0,0 +1,14 @@
+Document: kicad-doc-id
+Title: Various KiCad documentation
+Author: KiCad developer and contributers
+Abstract: Documentation and Manuals for the KiCad EDA suite that was build
+ from the provided source.
+Section: Help/HOWTO
+
+Format: HTML
+Index: /usr/share/doc/kicad/help/id/
+Files: /usr/share/doc/kicad/help/id/*.html
+       /usr/share/doc/kicad/help/id/images/*
+
+Format: PDF
+Files: /usr/share/doc/kicad/help/id/getting_started_in_kicad.pdf.gz
diff --git a/debian/kicad-doc-id.install b/debian/kicad-doc-id.install
new file mode 100644
index 00000000..97b6e6fb
--- /dev/null
+++ b/debian/kicad-doc-id.install
@@ -0,0 +1 @@
+usr/share/doc/kicad/help/id
diff --git a/debian/man/idf2vrml.1 b/debian/man/idf2vrml.1
index c5d371c0..93c221c5 100644
--- a/debian/man/idf2vrml.1
+++ b/debian/man/idf2vrml.1
@@ -39,7 +39,7 @@ Tto produce a model for use by KiCad:
 .RS 4
 .\}
 .nf
-idf2vrml \-f input.emn \-s 0.3937008 -k
+idf2vrml \-f input.emn \-s 0.3937008 \-k
 .fi
 
 .SH AUTHOR
diff --git 
a/debian/patches/debian-hacks/Remove-download-target-for-noAvhttp.patch 
b/debian/patches/debian-hacks/Remove-download-target-for-noAvhttp.patch
deleted file mode 100644
index 1d111e61..00000000
--- a/debian/patches/debian-hacks/Remove-download-target-for-noAvhttp.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Georges Khaznadar <georg...@debian.org>
-Date: Sat, 3 Sep 2016 17:57:10 +0200
-Subject: Remove download target for noAvhttp
-
-In Debian we don't load anything dynamically from the net while package
-built.
----
- CMakeModules/download_avhttp.cmake | 27 ---------------------------
- 1 file changed, 27 deletions(-)
-
-diff --git a/CMakeModules/download_avhttp.cmake 
b/CMakeModules/download_avhttp.cmake
-index abc52b7e..1827273d 100644
---- a/CMakeModules/download_avhttp.cmake
-+++ b/CMakeModules/download_avhttp.cmake
-@@ -35,31 +35,4 @@
- 
#-----</configure>-----------------------------------------------------------------------------------
- 
- 
--# Where the library is to be installed.
--set( PREFIX ${DOWNLOAD_DIR}/avhttp )
--
--if( KICAD_SKIP_BOOST )
--    set( AVHTTP_DEPEND "" )
--else()
--    set( AVHTTP_DEPEND "boost" )
--endif()
--
--
--# Install the AVHTTP header only library ${PREFIX}
--ExternalProject_Add( avhttp
--    PREFIX          ${PREFIX}
--    DOWNLOAD_DIR    ${DOWNLOAD_DIR}     # no true download yet
--
--    # grab it from a local zip file for now, cmake caller's source dir
--    URL             ${CMAKE_CURRENT_SOURCE_DIR}/avhttp-master.zip
--    DEPENDS         ${AVHTTP_DEPEND}
--
--    CONFIGURE_COMMAND ""
--
--    BUILD_COMMAND   ""
--    INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR> 
<INSTALL_DIR>
--    )
--
--
--set( AVHTTP_INCLUDE_DIR  "${PREFIX}/include" CACHE FILEPATH "AVHTTP include 
directory" )
- mark_as_advanced( AVHTTP_INCLUDE_DIR )
diff --git a/debian/patches/fixes/Fix-issue-170-for-real.patch 
b/debian/patches/fixes/Fix-issue-170-for-real.patch
deleted file mode 100644
index 8fa20fed..00000000
--- a/debian/patches/fixes/Fix-issue-170-for-real.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: =?utf-8?q?Nick_=C3=98stergaard?= <oe.n...@gmail.com>
-Date: Sun, 18 Dec 2016 22:16:22 +0100
-Subject: Fix issue #170 -- for real
-
-(Notes by Carsten Schoenert)
-Upstream fix for kicad-doc commited after the release of v4.0.5.
-This patch will automatically fall out of the patch queue with the next
-version 4.0.6.
-This commit isn't fixing the installation of the default images. For
-this we need another fix.
----
- doc/CMakeModules/KiCadDocumentation.cmake | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/doc/CMakeModules/KiCadDocumentation.cmake 
b/doc/CMakeModules/KiCadDocumentation.cmake
-index e4c91e46..884f46bf 100644
---- a/doc/CMakeModules/KiCadDocumentation.cmake
-+++ b/doc/CMakeModules/KiCadDocumentation.cmake
-@@ -136,7 +136,14 @@ macro( KiCadDocumentation DOCNAME )
-             add_dependencies( ${DOCNAME} ${DOCNAME}_html_${LANGUAGE} )
- 
-             install( FILES 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/${DOCNAME}.html DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE} COMPONENT html-${LANGUAGE} )
--            install( DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/ DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} OPTIONAL 
PATTERN "*.png")
-+
-+            # It seems to be nescesary to use diffrent install commands to
-+            # install the images properly without having other lagunages
-+            # polluting the images folder
-+            install( DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/${LANGUAGE} DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} OPTIONAL 
PATTERN "*.png")
-+            install( DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/icons DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} OPTIONAL 
PATTERN "*.png")
-+            file(GLOB UNIVERSAL_IMAGES 
"${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/*.png")
-+            install( FILES ${UNIVERSAL_IMAGES} DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} )
-         endif()
- 
- 
diff --git 
a/debian/patches/fixes/KiCadDocumentation.cmake-fix-install-target-for-HTML-docu.patch
 
b/debian/patches/fixes/KiCadDocumentation.cmake-fix-install-target-for-HTML-docu.patch
deleted file mode 100644
index 2c00b902..00000000
--- 
a/debian/patches/fixes/KiCadDocumentation.cmake-fix-install-target-for-HTML-docu.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From: Carsten Schoenert <c.schoen...@t-online.de>
-Date: Sun, 25 Sep 2016 09:56:25 +0200
-Subject: KiCadDocumentation.cmake: fix install target for HTML docu
-
-The old default behaviour while installing the generated HTML content is
-to install the whole images/$LANG folders into every generated language.
-This was producing a lot of useless duplicated data.  After applying a
-commit from upstream [1] this problem was partially fixed, but the
-default images were not installed.
-
-This commit fixes changing the kind of creating the list for the default
-images that will be installed in a next step. Also the images from the
-English language is needed as some howtos use them.
-
-[1] 
https://github.com/KiCad/kicad-doc/commit/027c096941105048da8921ac2d8bc4d1594b14a9
----
- doc/CMakeModules/KiCadDocumentation.cmake | 16 +++++++++++-----
- 1 file changed, 11 insertions(+), 5 deletions(-)
-
-diff --git a/doc/CMakeModules/KiCadDocumentation.cmake 
b/doc/CMakeModules/KiCadDocumentation.cmake
-index 884f46bf..8c80b030 100644
---- a/doc/CMakeModules/KiCadDocumentation.cmake
-+++ b/doc/CMakeModules/KiCadDocumentation.cmake
-@@ -136,14 +136,20 @@ macro( KiCadDocumentation DOCNAME )
-             add_dependencies( ${DOCNAME} ${DOCNAME}_html_${LANGUAGE} )
- 
-             install( FILES 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/${DOCNAME}.html DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE} COMPONENT html-${LANGUAGE} )
-+            # install the images/en/ folder if not already done, the folder 
contains the default images
-+            if( NOT "${KICAD_DOC_PATH}/${LANGUAGE}/images/en" EQUAL "-1" )
-+                install( DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/en DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} OPTIONAL 
PATTERN "*.png")
-+            endif()
- 
--            # It seems to be nescesary to use diffrent install commands to
--            # install the images properly without having other lagunages
--            # polluting the images folder
-+            # collectings the default *.png files from the source tree and 
install them
-+            file( GLOB COMMONPNGFILES RELATIVE 
"${CMAKE_CURRENT_SOURCE_DIR}/images" "${CMAKE_CURRENT_SOURCE_DIR}/images/*.png" 
)
-+            foreach( PNGFILE ${COMMONPNGFILES} )
-+                # install the common used images into the root images folder
-+                install( FILES 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/${PNGFILE} DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} )
-+            endforeach()
-+            # install the specific images from the desired language
-             install( DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/${LANGUAGE} DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} OPTIONAL 
PATTERN "*.png")
-             install( DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/icons DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} OPTIONAL 
PATTERN "*.png")
--            file(GLOB UNIVERSAL_IMAGES 
"${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGE}/images/*.png")
--            install( FILES ${UNIVERSAL_IMAGES} DESTINATION 
${KICAD_DOC_PATH}/${LANGUAGE}/images COMPONENT html-${LANGUAGE} )
-         endif()
- 
- 
diff --git a/debian/patches/fixes/Remove-unused-FindOpenSSL.cmake.patch 
b/debian/patches/fixes/Remove-unused-FindOpenSSL.cmake.patch
deleted file mode 100644
index eb382c2e..00000000
--- a/debian/patches/fixes/Remove-unused-FindOpenSSL.cmake.patch
+++ /dev/null
@@ -1,357 +0,0 @@
-From: Simon Richter <simon.rich...@hogyros.de>
-Date: Thu, 5 May 2016 10:31:26 +0200
-Subject: Remove unused FindOpenSSL.cmake
-
----
- CMakeModules/FindOpenSSL.cmake | 342 -----------------------------------------
- 1 file changed, 342 deletions(-)
- delete mode 100644 CMakeModules/FindOpenSSL.cmake
-
-diff --git a/CMakeModules/FindOpenSSL.cmake b/CMakeModules/FindOpenSSL.cmake
-deleted file mode 100644
-index de91787c..00000000
---- a/CMakeModules/FindOpenSSL.cmake
-+++ /dev/null
-@@ -1,342 +0,0 @@
--#.rst:
--# FindOpenSSL
--# -----------
--#
--# Try to find the OpenSSL encryption library
--#
--# Once done this will define
--#
--# ::
--#
--#   OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
--#
--#
--#
--# Read-Only variables:
--#
--# ::
--#
--#   OPENSSL_FOUND - system has the OpenSSL library
--#   OPENSSL_INCLUDE_DIR - the OpenSSL include directory
--#   OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
--#   OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
--
--#=============================================================================
--# Copyright 2006-2009 Kitware, Inc.
--# Copyright 2006 Alexander Neundorf <neund...@kde.org>
--# Copyright 2009-2011 Mathieu Malaterre <mathieu.malate...@gmail.com>
--#
--# Distributed under the OSI-approved BSD License (the "License");
--# see accompanying file Copyright.txt for details.
--#
--# This software is distributed WITHOUT ANY WARRANTY; without even the
--# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--# See the License for more information.
--#=============================================================================
--# (To distribute this file outside of CMake, substitute the full
--#  License text for the above reference.)
--
--if (UNIX)
--  find_package(PkgConfig QUIET)
--  pkg_check_modules(_OPENSSL QUIET openssl)
--endif ()
--
--if (WIN32)
--  # http://www.slproweb.com/products/Win32OpenSSL.html
--  set(_OPENSSL_ROOT_HINTS
--    ${OPENSSL_ROOT_DIR}
--    
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL
 (32-bit)_is1;Inno Setup: App Path]"
--    
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL
 (64-bit)_is1;Inno Setup: App Path]"
--    ENV OPENSSL_ROOT_DIR
--    )
--  file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
--  set(_OPENSSL_ROOT_PATHS
--    "${_programfiles}/OpenSSL"
--    "${_programfiles}/OpenSSL-Win32"
--    "${_programfiles}/OpenSSL-Win64"
--    "C:/OpenSSL/"
--    "C:/OpenSSL-Win32/"
--    "C:/OpenSSL-Win64/"
--    )
--  unset(_programfiles)
--else ()
--  set(_OPENSSL_ROOT_HINTS
--    ${OPENSSL_ROOT_DIR}
--    ENV OPENSSL_ROOT_DIR
--    )
--endif ()
--
--set(_OPENSSL_ROOT_HINTS_AND_PATHS
--    HINTS ${_OPENSSL_ROOT_HINTS}
--    PATHS ${_OPENSSL_ROOT_PATHS}
--    )
--
--find_path(OPENSSL_INCLUDE_DIR
--  NAMES
--    openssl/ssl.h
--    ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--  HINTS
--    ${_OPENSSL_INCLUDEDIR}
--  PATH_SUFFIXES
--    include
--)
--
--if(WIN32 AND NOT CYGWIN)
--  if(MSVC)
--    # /MD and /MDd are the standard values - if someone wants to use
--    # others, the libnames have to change here too
--    # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
--    # TODO: handle /MT and static lib
--    # In Visual C++ naming convention each of these four kinds of Windows 
libraries has it's standard suffix:
--    #   * MD for dynamic-release
--    #   * MDd for dynamic-debug
--    #   * MT for static-release
--    #   * MTd for static-debug
--
--    # Implementation details:
--    # We are using the libraries located in the VC subdir instead of the 
parent directory eventhough :
--    # libeay32MD.lib is identical to ../libeay32.lib, and
--    # ssleay32MD.lib is identical to ../ssleay32.lib
--    find_library(LIB_EAY_DEBUG
--      NAMES
--        libeay32MDd
--        libeay32d
--        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      PATH_SUFFIXES
--        "lib"
--        "VC"
--        "lib/VC"
--    )
--
--    find_library(LIB_EAY_RELEASE
--      NAMES
--        libeay32MD
--        libeay32
--        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      PATH_SUFFIXES
--        "lib"
--        "VC"
--        "lib/VC"
--    )
--
--    find_library(SSL_EAY_DEBUG
--      NAMES
--        ssleay32MDd
--        ssleay32d
--        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      PATH_SUFFIXES
--        "lib"
--        "VC"
--        "lib/VC"
--    )
--
--    find_library(SSL_EAY_RELEASE
--      NAMES
--        ssleay32MD
--        ssleay32
--        ssl
--        ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      PATH_SUFFIXES
--        "lib"
--        "VC"
--        "lib/VC"
--    )
--
--    set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
--    set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
--    set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
--    set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
--
--    include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
--    select_library_configurations(LIB_EAY)
--    select_library_configurations(SSL_EAY)
--
--    mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE
--                     SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE)
--    set( OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
--  elseif(MINGW)
--    message( STATUS "Searching for OpenSSL in MinGW." )
--    # same player, for MinGW
--    set(LIB_EAY_NAMES libeay32)
--    set(SSL_EAY_NAMES ssleay32)
--    list(APPEND LIB_EAY_NAMES crypto)
--    list(APPEND SSL_EAY_NAMES ssl)
--
--    find_library(LIB_EAY
--      NAMES
--        ${LIB_EAY_NAMES}
--      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      PATH_SUFFIXES
--        "lib"
--        "lib/MinGW"
--      # Do not search system path.  Otherwise the DLL will be found rather 
than the link library.
--      NO_SYSTEM_ENVIRONMENT_PATH
--      NO_CMAKE_SYSTEM_PATH
--    )
--
--    find_library(SSL_EAY
--      NAMES
--        ${SSL_EAY_NAMES}
--      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      PATH_SUFFIXES
--        "lib"
--        "lib/MinGW"
--      # Do not search system path.  Otherwise the DLL will be found rather 
than the link library.
--      NO_SYSTEM_ENVIRONMENT_PATH
--      NO_CMAKE_SYSTEM_PATH
--    )
--
--    mark_as_advanced(SSL_EAY LIB_EAY)
--    set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
--    unset(LIB_EAY_NAMES)
--    unset(SSL_EAY_NAMES)
--  else()
--    # Not sure what to pick for -say- intel, let's use the toplevel ones and 
hope someone report issues:
--    find_library(LIB_EAY
--      NAMES
--        libeay32
--      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      HINTS
--        ${_OPENSSL_LIBDIR}
--      PATH_SUFFIXES
--        lib
--    )
--
--    find_library(SSL_EAY
--      NAMES
--        ssleay32
--      ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--      HINTS
--        ${_OPENSSL_LIBDIR}
--      PATH_SUFFIXES
--        lib
--    )
--
--    mark_as_advanced(SSL_EAY LIB_EAY)
--    set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
--  endif()
--else()
--
--  find_library(OPENSSL_SSL_LIBRARY
--    NAMES
--      ssl
--      ssleay32
--      ssleay32MD
--    ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--    HINTS
--      ${_OPENSSL_LIBDIR}
--    PATH_SUFFIXES
--      lib
--  )
--
--  find_library(OPENSSL_CRYPTO_LIBRARY
--    NAMES
--      crypto
--    ${_OPENSSL_ROOT_HINTS_AND_PATHS}
--    HINTS
--      ${_OPENSSL_LIBDIR}
--    PATH_SUFFIXES
--      lib
--  )
--
--  mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
--
--  # compat defines
--  set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
--  set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
--
--  set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
--
--endif()
--
--function(from_hex HEX DEC)
--  string(TOUPPER "${HEX}" HEX)
--  set(_res 0)
--  string(LENGTH "${HEX}" _strlen)
--
--  while (_strlen GREATER 0)
--    math(EXPR _res "${_res} * 16")
--    string(SUBSTRING "${HEX}" 0 1 NIBBLE)
--    string(SUBSTRING "${HEX}" 1 -1 HEX)
--    if (NIBBLE STREQUAL "A")
--      math(EXPR _res "${_res} + 10")
--    elseif (NIBBLE STREQUAL "B")
--      math(EXPR _res "${_res} + 11")
--    elseif (NIBBLE STREQUAL "C")
--      math(EXPR _res "${_res} + 12")
--    elseif (NIBBLE STREQUAL "D")
--      math(EXPR _res "${_res} + 13")
--    elseif (NIBBLE STREQUAL "E")
--      math(EXPR _res "${_res} + 14")
--    elseif (NIBBLE STREQUAL "F")
--      math(EXPR _res "${_res} + 15")
--    else()
--      math(EXPR _res "${_res} + ${NIBBLE}")
--    endif()
--
--    string(LENGTH "${HEX}" _strlen)
--  endwhile()
--
--  set(${DEC} ${_res} PARENT_SCOPE)
--endfunction()
--
--if (OPENSSL_INCLUDE_DIR)
--  if (_OPENSSL_VERSION)
--    set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
--  elseif(OPENSSL_INCLUDE_DIR AND EXISTS 
"${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
--    file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" 
openssl_version_str
--         REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t 
]+0x([0-9a-fA-F])+.*")
--
--    # The version number is encoded as 0xMNNFFPPS: major minor fix patch 
status
--    # The status gives if this is a developer or prerelease and is ignored 
here.
--    # Major, minor, and fix directly translate into the version numbers shown 
in
--    # the string. The patch field translates to the single character suffix 
that
--    # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and 
so
--    # on.
--
--    message(STATUS "OPENSSL_VERSION_STR=${openssl_version_str}")
--
--    string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t 
]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
--           "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST 
"${openssl_version_str}")
--    list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
--    list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
--    from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
--    list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
--    from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
--    list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
--
--    if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
--      from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
--      # 96 is the ASCII code of 'a' minus 1
--      math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
--      unset(_tmp)
--      # Once anyone knows how OpenSSL would call the patch versions beyond 'z'
--      # this should be updated to handle that, too. This has not happened yet
--      # so it is simply ignored here for now.
--      string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" 
OPENSSL_VERSION_PATCH_STRING)
--    endif ()
--
--    set(OPENSSL_VERSION 
"${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
--  endif ()
--endif ()
--
--include(FindPackageHandleStandardArgs)
--
--if (OPENSSL_VERSION)
--  find_package_handle_standard_args(OpenSSL
--    REQUIRED_VARS
--      OPENSSL_LIBRARIES
--      OPENSSL_INCLUDE_DIR
--    VERSION_VAR
--      OPENSSL_VERSION
--    FAIL_MESSAGE
--      "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in 
the system variable OPENSSL_ROOT_DIR"
--  )
--else ()
--  find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to 
set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
--    OPENSSL_LIBRARIES
--    OPENSSL_INCLUDE_DIR
--  )
--endif ()
--
--mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
diff --git a/debian/patches/fixes/Replace-avhttp-with-libcurl.patch 
b/debian/patches/fixes/Replace-avhttp-with-libcurl.patch
deleted file mode 100644
index 54b932c1..00000000
--- a/debian/patches/fixes/Replace-avhttp-with-libcurl.patch
+++ /dev/null
@@ -1,295 +0,0 @@
-From: unknown <mark.ros...@gmail.com>
-Date: Tue, 22 Dec 2015 15:19:00 +0100
-Subject: Replace avhttp with libcurl
-
-Some fixes:
-1. Fixed an assumption somebody originally made in the plugin that
-   std::string had contiguous storage. This is not specced behavior pre
-   C++11 so we gamble by calling .reserve() which should give a far
-   better guarantee.
-
-2. Added copy to clipboard information for curl
-
-3. Removed some openssl references in compiling.md
-
-4. Renamed struct vars to be uppercase to match "public var" code style
-   policy
----
- Documentation/development/compiling.md | 12 +-----------
- common/basicframe.cpp                  |  3 +++
- common/kicad_curl/kicad_curl.cpp       | 26 ++++++++++++++++++++++++++
- common/kicad_curl/kicad_curl_easy.cpp  | 26 +++++++++++++-------------
- include/kicad_curl/kicad_curl.h        |  7 +++++++
- include/kicad_curl/kicad_curl_easy.h   |  6 +++---
- pcbnew/github/CMakeLists.txt           |  2 --
- pcbnew/github/github_getliblist.cpp    |  5 +++--
- pcbnew/github/github_plugin.cpp        |  3 ++-
- 9 files changed, 58 insertions(+), 32 deletions(-)
-
-diff --git a/Documentation/development/compiling.md 
b/Documentation/development/compiling.md
-index 90cea955..6a5ac92c 100644
---- a/Documentation/development/compiling.md
-+++ b/Documentation/development/compiling.md
-@@ -78,14 +78,6 @@ specific patches required to build a working Boost library. 
 These patches can b
- [patches folder][] in the KiCad source.  These patches are named by the 
platform name they should
- be applied against.
- 
--## OpenSSL Secure Socket Layer Library ## {#openssl}
--
--The [OpenSSL][] library is only required when the KiCad build is configured 
with the Github plugin
--enabled.  See the [KiCad Build Configuration Options](#build_opts)` section 
for more information.
--Please note that KiCad will download and build version 1.0.1e of OpenSSL by 
default.  You should
--probably use the version of OpenSSL installed on your system as it will most 
likely be more up to
--date and contain the latest security fixes.
--
- ## GLEW OpenGL Extension Wrangler Library ## {#glew}
- 
- The [OpenGL Extension Wrangler][GLEW] is an OpenGL helper library used by the 
KiCad graphics
-@@ -299,7 +291,7 @@ the following commands:
-               mingw-w64-x86_64-boost \
-               mingw-w64-x86_64-cairo \
-               mingw-w64-x86_64-glew \
--              mingw-w64-x86_64-openssl \
-+              mingw-w64-x86_64-curl \
-               mingw-w64-x86_64-wxPython \
-               mingw-w64-x86_64-wxWidgets
-     cd kicad-source
-@@ -311,7 +303,6 @@ the following commands:
-           -DCMAKE_PREFIX_PATH=/mingw64 \
-           -DCMAKE_INSTALL_PREFIX=/mingw64 \
-           -DDEFAULT_INSTALL_PATH=/mingw64 \
--          -DOPENSSL_ROOT_DIR=/mingw64 \
-           -DKICAD_SKIP_BOOST=ON \
-           -DKICAD_SCRIPTING=ON \
-           -DKICAD_SCRIPTING_MODULES=ON \
-@@ -408,7 +399,6 @@ Boost patches in the KiCad source [patch folder][].
- [wxWidgets]: http://wxwidgets.org/
- [patches folder]: 
http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/files/head:/patches/
- [Boost]: http://www.boost.org/
--[OpenSSL]: https://www.openssl.org/
- [GLEW]: http://glew.sourceforge.net/
- [GLUT]: https://www.opengl.org/resources/libraries/glut/
- [Cairo]: http://cairographics.org/
-diff --git a/common/basicframe.cpp b/common/basicframe.cpp
-index 46ddd550..815247d0 100644
---- a/common/basicframe.cpp
-+++ b/common/basicframe.cpp
-@@ -28,6 +28,7 @@
-  * @brief EDA_BASE_FRAME class implementation.
-  */
- 
-+#include <kicad_curl/kicad_curl.h> /* Include before any wx file */
- #include <wx/aboutdlg.h>
- #include <wx/fontdlg.h>
- #include <wx/clipbrd.h>
-@@ -580,6 +581,8 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( 
wxCommandEvent&  event )
-                 << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
-                 << ( BOOST_VERSION % 100 ) << wxT( "\n" );
- 
-+    msg_version <<  KICAD_CURL::GetSimpleVersion() << wxT( "\n" );
-+
-     msg_version << wxT( "         USE_WX_GRAPHICS_CONTEXT=" );
- #ifdef USE_WX_GRAPHICS_CONTEXT
-     msg_version << wxT( "ON\n" );
-diff --git a/common/kicad_curl/kicad_curl.cpp 
b/common/kicad_curl/kicad_curl.cpp
-index 7424eec8..0df25288 100644
---- a/common/kicad_curl/kicad_curl.cpp
-+++ b/common/kicad_curl/kicad_curl.cpp
-@@ -51,4 +51,30 @@ std::string KICAD_CURL::GetVersion()
- }
- 
- 
-+std::string KICAD_CURL::GetSimpleVersion()
-+{
-+    curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
-+
-+    std::string res;
-+
-+    if( info->version )
-+    {
-+        res += "libcurl version: " + std::string(info->version);
-+    }
-+
-+    res += " (";
-+    if( info->features & CURL_VERSION_SSL )
-+    {
-+        res += "with SSL - ";
-+        res += std::string(info->ssl_version);
-+    }
-+    else
-+    {
-+        res += "without SSL";
-+    }
-+    res += ")";
-+
-+    return res;
-+}
-+
- bool KICAD_CURL::m_initialized = false;
-\ No newline at end of file
-diff --git a/common/kicad_curl/kicad_curl_easy.cpp 
b/common/kicad_curl/kicad_curl_easy.cpp
-index 71a410d0..4dadf043 100644
---- a/common/kicad_curl/kicad_curl_easy.cpp
-+++ b/common/kicad_curl/kicad_curl_easy.cpp
-@@ -43,8 +43,8 @@ KICAD_CURL_EASY::KICAD_CURL_EASY()
-         THROW_IO_ERROR( "Unable to initialize CURL session" );
-     }
- 
--    m_Buffer.payload = (char*)malloc( 1 );
--    m_Buffer.size = 0;
-+    m_Buffer.Payload = (char*)malloc( 1 );
-+    m_Buffer.Size = 0;
- 
-     curl_easy_setopt( m_CURL, CURLOPT_WRITEFUNCTION, write_callback );
-     curl_easy_setopt( m_CURL, CURLOPT_WRITEDATA, (void *)&m_Buffer );
-@@ -53,7 +53,7 @@ KICAD_CURL_EASY::KICAD_CURL_EASY()
- 
- KICAD_CURL_EASY::~KICAD_CURL_EASY()
- {
--    free(m_Buffer.payload);
-+    free(m_Buffer.Payload);
-     curl_easy_cleanup(m_CURL);
- }
- 
-@@ -110,27 +110,27 @@ static size_t write_callback( void *contents, size_t 
size, size_t nmemb, void *u
-     struct KICAD_EASY_CURL_BUFFER *p = ( struct KICAD_EASY_CURL_BUFFER * ) 
userp;
- 
-     /* expand buffer */
--    p->payload = (char *) realloc( p->payload, p->size + realsize + 1 );
-+    p->Payload = (char *) realloc( p->Payload, p->Size + realsize + 1 );
- 
-     /* check buffer */
--    if ( p->payload == NULL )
-+    if ( p->Payload == NULL )
-     {
-         wxLogError( wxT( "Failed to expand buffer in curl_callback" ) );
- 
-         /* free buffer */
--        free( p->payload );
-+        free( p->Payload );
- 
-         return -1;
-     }
- 
-     /* copy contents to buffer */
--    memcpy( &(p->payload[p->size]), contents, realsize );
-+    memcpy( &(p->Payload[p->Size]), contents, realsize );
- 
-     /* set new buffer size */
--    p->size += realsize;
-+    p->Size += realsize;
- 
-     /* ensure null termination */
--    p->payload[p->size] = 0;
-+    p->Payload[p->Size] = 0;
- 
-     /* return size */
-     return realsize;
-@@ -144,11 +144,11 @@ void KICAD_CURL_EASY::Perform()
-         curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
-     }
- 
--    if( m_Buffer.size > 0 )
-+    if( m_Buffer.Size > 0 )
-     {
--        free( m_Buffer.payload );
--        m_Buffer.payload = (char*)malloc( 1 );
--        m_Buffer.size = 0;
-+        free( m_Buffer.Payload );
-+        m_Buffer.Payload = (char*)malloc( 1 );
-+        m_Buffer.Size = 0;
-     }
- 
-     CURLcode res = curl_easy_perform( m_CURL );
-diff --git a/include/kicad_curl/kicad_curl.h b/include/kicad_curl/kicad_curl.h
-index 3639400c..ef49f92d 100644
---- a/include/kicad_curl/kicad_curl.h
-+++ b/include/kicad_curl/kicad_curl.h
-@@ -75,6 +75,13 @@ public:
-      */
-     static std::string GetVersion();
- 
-+    /**
-+     * Function GetSimpleVersion
-+     * Reports back curl version only and SSL library support
-+     *
-+     * @return std::string - Generated version string
-+     */
-+    static std::string GetSimpleVersion();
- private:
-     static bool m_initialized;
- };
-diff --git a/include/kicad_curl/kicad_curl_easy.h 
b/include/kicad_curl/kicad_curl_easy.h
-index a87c3d02..2273e489 100644
---- a/include/kicad_curl/kicad_curl_easy.h
-+++ b/include/kicad_curl/kicad_curl_easy.h
-@@ -52,8 +52,8 @@
-  */
- struct KICAD_EASY_CURL_BUFFER
- {
--    char* payload;
--    size_t size;
-+    char* Payload;
-+    size_t Size;
- };
- 
- 
-@@ -142,7 +142,7 @@ public:
-      * @param aArg is the argument being passed to CURL, ensure it is the 
right type per manual
-      * @return CURLcode - CURL error code, will return CURLE_OK unless a 
problem was encountered
-      */
--    template <typename T> CURLcode SetOption( CURLoption aOption, T aArg ) 
-+    template <typename T> CURLcode SetOption( CURLoption aOption, T aArg )
-     { 
-         return curl_easy_setopt( m_CURL, aOption, aArg ); 
-     }
-diff --git a/pcbnew/github/CMakeLists.txt b/pcbnew/github/CMakeLists.txt
-index bb37ebf5..c6615e48 100644
---- a/pcbnew/github/CMakeLists.txt
-+++ b/pcbnew/github/CMakeLists.txt
-@@ -32,8 +32,6 @@ set( GITHUB_PLUGIN_SRCS
- 
- add_library( github_plugin STATIC ${GITHUB_PLUGIN_SRCS} )
- 
--# No, you don't get github without boost and openssl. Boost_LIBRARIES now 
moved up
--# into CMakeLists.txt for pcbnew and cvpcb:
- target_link_libraries( github_plugin
-     common
-     )
-diff --git a/pcbnew/github/github_getliblist.cpp 
b/pcbnew/github/github_getliblist.cpp
-index baf5f7c2..6c8f8852 100644
---- a/pcbnew/github/github_getliblist.cpp
-+++ b/pcbnew/github/github_getliblist.cpp
-@@ -212,7 +212,7 @@ bool GITHUB_GETLIBLIST::repoURL2listURL( const wxString& 
aRepoURL,
- bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& aFullURLCommand, 
wxString* aMsgError )
- {
-     KICAD_CURL_EASY kcurl;
--    
-+
-     wxLogDebug( wxT( "Attempting to download: " ) + aFullURLCommand );
- 
-     kcurl.SetURL(aFullURLCommand);
-@@ -223,7 +223,8 @@ bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& 
aFullURLCommand, wxStr
-     try
-     {
-         kcurl.Perform();
--        m_image.assign(kcurl.GetBuffer()->payload, kcurl.GetBuffer()->size);
-+        m_image.reserve( kcurl.GetBuffer()->Size );
-+        m_image.assign( kcurl.GetBuffer()->Payload, kcurl.GetBuffer()->Size );
-         return true;
-     }
-     catch( const IO_ERROR& ioe )
-diff --git a/pcbnew/github/github_plugin.cpp b/pcbnew/github/github_plugin.cpp
-index db96ae18..321e0b76 100644
---- a/pcbnew/github/github_plugin.cpp
-+++ b/pcbnew/github/github_plugin.cpp
-@@ -538,7 +538,8 @@ void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL 
) throw( IO_ERROR )
-     try
-     {
-         kcurl.Perform();
--        m_zip_image.assign(kcurl.GetBuffer()->payload, 
kcurl.GetBuffer()->size);
-+        m_zip_image.reserve( kcurl.GetBuffer()->Size );
-+        m_zip_image.assign( kcurl.GetBuffer()->Payload, 
kcurl.GetBuffer()->Size );
-     }
-     catch( const IO_ERROR& ioe )
-     {
diff --git 
a/debian/patches/fixes/Replace-the-avhttp-library-used-by-the-github-plugin-with.patch
 
b/debian/patches/fixes/Replace-the-avhttp-library-used-by-the-github-plugin-with.patch
deleted file mode 100644
index 84bdd597..00000000
--- 
a/debian/patches/fixes/Replace-the-avhttp-library-used-by-the-github-plugin-with.patch
+++ /dev/null
@@ -1,1061 +0,0 @@
-From: Mark Roszko <mark.ros...@gmail.com>
-Date: Mon, 21 Dec 2015 15:30:33 -0500
-Subject: Replace the avhttp library used by the github plugin with libcurl.
-
----
- CMakeLists.txt                        |   5 +
- common/CMakeLists.txt                 |   6 +-
- common/kicad_curl/kicad_curl.cpp      |  54 +++++++++++
- common/kicad_curl/kicad_curl_easy.cpp | 163 +++++++++++++++++++++++++++++++++
- common/pgm_base.cpp                   |   9 ++
- include/kicad_curl/kicad_curl.h       |  82 +++++++++++++++++
- include/kicad_curl/kicad_curl_easy.h  | 166 ++++++++++++++++++++++++++++++++++
- pcbnew/github/CMakeLists.txt          |  39 +-------
- pcbnew/github/github_getliblist.cpp   |  68 +++++++-------
- pcbnew/github/github_getliblist.h     |   4 +-
- pcbnew/github/github_plugin.cpp       | 151 ++++++-------------------------
- pcbnew/github/github_plugin.h         |   6 +-
- 12 files changed, 560 insertions(+), 193 deletions(-)
- create mode 100644 common/kicad_curl/kicad_curl.cpp
- create mode 100644 common/kicad_curl/kicad_curl_easy.cpp
- create mode 100644 include/kicad_curl/kicad_curl.h
- create mode 100644 include/kicad_curl/kicad_curl_easy.h
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 6eea373a..858ea58a 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -569,6 +569,11 @@ if( NOT GLEW_FOUND )
-     check_find_package_result( GLEW_FOUND "GLEW" )
- endif()
- 
-+#####################
-+# Find CURL library #
-+#####################
-+find_package( CURL REQUIRED )
-+
- ######################
- # Find Cairo library #
- ######################
-diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
-index c9fbd29b..c2bd2cb2 100644
---- a/common/CMakeLists.txt
-+++ b/common/CMakeLists.txt
-@@ -4,6 +4,7 @@ include_directories(
-     ./dialog_about
-     ${CAIRO_INCLUDE_DIR}
-     ${GLEW_INCLUDE_DIR}
-+    ${CURL_INCLUDE_DIRS}
-     ../3d-viewer
-     ../pcbnew
-     ../polygon
-@@ -257,6 +258,9 @@ endif()
- 
- set( COMMON_SRCS
-     ${COMMON_SRCS}
-+    kicad_curl/kicad_curl.cpp
-+    kicad_curl/kicad_curl_easy.cpp
-+
-     view/view.cpp
-     view/view_item.cpp
-     view/view_group.cpp
-@@ -282,7 +286,7 @@ set( COMMON_SRCS
- add_library( common STATIC ${COMMON_SRCS} )
- add_dependencies( common lib-dependencies )
- add_dependencies( common version_header )
--target_link_libraries( common ${Boost_LIBRARIES} )
-+target_link_libraries( common ${Boost_LIBRARIES} ${CURL_LIBRARIES} )
- 
- 
- set( PCB_COMMON_SRCS
-diff --git a/common/kicad_curl/kicad_curl.cpp 
b/common/kicad_curl/kicad_curl.cpp
-new file mode 100644
-index 00000000..7424eec8
---- /dev/null
-+++ b/common/kicad_curl/kicad_curl.cpp
-@@ -0,0 +1,54 @@
-+/*
-+ * This program source code file is part of KiCad, a free EDA CAD application.
-+ *
-+ * Copyright (C) 2015 Mark Roszko <mark.ros...@gmail.com>
-+ * Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 3
-+ * of the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, you may find one here:
-+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-+ * or you may search the http://www.gnu.org website for the version 2 license,
-+ * or you may write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-+ */
-+
-+#include <kicad_curl/kicad_curl.h>
-+
-+bool KICAD_CURL::Init()
-+{
-+    if ( curl_global_init( CURL_GLOBAL_ALL ) != CURLE_OK )
-+    {
-+        return false;
-+    }
-+    else
-+    {
-+        m_initialized = true;
-+        return true;
-+    }
-+}
-+
-+
-+void KICAD_CURL::Cleanup()
-+{
-+    if( m_initialized )
-+        curl_global_cleanup();
-+}
-+
-+
-+std::string KICAD_CURL::GetVersion()
-+{
-+    return std::string( curl_version() );
-+}
-+
-+
-+bool KICAD_CURL::m_initialized = false;
-\ No newline at end of file
-diff --git a/common/kicad_curl/kicad_curl_easy.cpp 
b/common/kicad_curl/kicad_curl_easy.cpp
-new file mode 100644
-index 00000000..71a410d0
---- /dev/null
-+++ b/common/kicad_curl/kicad_curl_easy.cpp
-@@ -0,0 +1,163 @@
-+/*
-+ * This program source code file is part of KiCad, a free EDA CAD application.
-+ *
-+ * Copyright (C) 2015 Mark Roszko <mark.ros...@gmail.com>
-+ * Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 3
-+ * of the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, you may find one here:
-+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-+ * or you may search the http://www.gnu.org website for the version 2 license,
-+ * or you may write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-+ */
-+
-+#include <kicad_curl/kicad_curl_easy.h>
-+
-+#include <cstddef>
-+#include <exception>
-+#include <stdarg.h>
-+#include <sstream>
-+#include <richio.h>
-+
-+static size_t write_callback (void *contents, size_t size, size_t nmemb, void 
*userp);
-+
-+
-+KICAD_CURL_EASY::KICAD_CURL_EASY()
-+    : m_headers( NULL )
-+{
-+    m_CURL = curl_easy_init();
-+
-+    if( m_CURL == NULL )
-+    {
-+        THROW_IO_ERROR( "Unable to initialize CURL session" );
-+    }
-+
-+    m_Buffer.payload = (char*)malloc( 1 );
-+    m_Buffer.size = 0;
-+
-+    curl_easy_setopt( m_CURL, CURLOPT_WRITEFUNCTION, write_callback );
-+    curl_easy_setopt( m_CURL, CURLOPT_WRITEDATA, (void *)&m_Buffer );
-+}
-+
-+
-+KICAD_CURL_EASY::~KICAD_CURL_EASY()
-+{
-+    free(m_Buffer.payload);
-+    curl_easy_cleanup(m_CURL);
-+}
-+
-+
-+bool KICAD_CURL_EASY::SetURL( const std::string& aURL )
-+{
-+    if( SetOption<const char *>( CURLOPT_URL, aURL.c_str() ) == CURLE_OK )
-+    {
-+        return true;
-+    }
-+    return false;
-+}
-+
-+
-+bool KICAD_CURL_EASY::SetUserAgent( const std::string& aAgent )
-+{
-+    if( SetOption<const char *>( CURLOPT_USERAGENT, aAgent.c_str() ) == 
CURLE_OK )
-+    {
-+        return true;
-+    }
-+    return false;
-+}
-+
-+
-+bool KICAD_CURL_EASY::SetFollowRedirects( bool aFollow )
-+{
-+    if( SetOption<long>( CURLOPT_FOLLOWLOCATION , (aFollow ? 1 : 0) ) == 
CURLE_OK )
-+    {
-+        return true;
-+    }
-+    return false;
-+}
-+
-+
-+void KICAD_CURL_EASY::SetHeader( const std::string& aName, const std::string& 
aValue )
-+{
-+    std::string header = aName + ':' + aValue;
-+    m_headers = curl_slist_append( m_headers, header.c_str() );
-+}
-+
-+
-+std::string KICAD_CURL_EASY::GetErrorText(CURLcode code)
-+{
-+    return curl_easy_strerror(code);
-+}
-+
-+
-+static size_t write_callback( void *contents, size_t size, size_t nmemb, void 
*userp )
-+{
-+    /* calculate buffer size */
-+    size_t realsize = size * nmemb;
-+
-+    /* cast pointer to fetch struct */
-+    struct KICAD_EASY_CURL_BUFFER *p = ( struct KICAD_EASY_CURL_BUFFER * ) 
userp;
-+
-+    /* expand buffer */
-+    p->payload = (char *) realloc( p->payload, p->size + realsize + 1 );
-+
-+    /* check buffer */
-+    if ( p->payload == NULL )
-+    {
-+        wxLogError( wxT( "Failed to expand buffer in curl_callback" ) );
-+
-+        /* free buffer */
-+        free( p->payload );
-+
-+        return -1;
-+    }
-+
-+    /* copy contents to buffer */
-+    memcpy( &(p->payload[p->size]), contents, realsize );
-+
-+    /* set new buffer size */
-+    p->size += realsize;
-+
-+    /* ensure null termination */
-+    p->payload[p->size] = 0;
-+
-+    /* return size */
-+    return realsize;
-+}
-+
-+
-+void KICAD_CURL_EASY::Perform()
-+{
-+    if( m_headers != NULL )
-+    {
-+        curl_easy_setopt( m_CURL, CURLOPT_HTTPHEADER, m_headers );
-+    }
-+
-+    if( m_Buffer.size > 0 )
-+    {
-+        free( m_Buffer.payload );
-+        m_Buffer.payload = (char*)malloc( 1 );
-+        m_Buffer.size = 0;
-+    }
-+
-+    CURLcode res = curl_easy_perform( m_CURL );
-+    if( res != CURLE_OK )
-+    {
-+        wxString msg = wxString::Format(
-+            _( "CURL Request Failed: %s" ),
-+            GetErrorText( res ) );
-+
-+        THROW_IO_ERROR( msg );
-+    }
-+}
-\ No newline at end of file
-diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp
-index e4894380..0fde3d66 100644
---- a/common/pgm_base.cpp
-+++ b/common/pgm_base.cpp
-@@ -30,6 +30,7 @@
-  *        (locale handling)
-  */
- 
-+#include <kicad_curl/kicad_curl.h> /* Include before any wx file */
- #include <fctsys.h>
- #include <wx/html/htmlwin.h>
- #include <wx/fs_zip.h>
-@@ -282,6 +283,7 @@ PGM_BASE::PGM_BASE()
- PGM_BASE::~PGM_BASE()
- {
-     destroy();
-+    KICAD_CURL::Cleanup();
- }
- 
- 
-@@ -510,6 +512,13 @@ bool PGM_BASE::initPgm()
-     wxSystemOptions::SetOption( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES, 1 );
- #endif
- 
-+    // Initialize CURL
-+    wxLogDebug( wxT( "Using %s" ), KICAD_CURL::GetVersion() );
-+    if( !KICAD_CURL::Init() )
-+    {
-+        wxLogDebug( wxT( "Error initializing libcurl" ) );
-+    }
-+
-     return true;
- }
- 
-diff --git a/include/kicad_curl/kicad_curl.h b/include/kicad_curl/kicad_curl.h
-new file mode 100644
-index 00000000..3639400c
---- /dev/null
-+++ b/include/kicad_curl/kicad_curl.h
-@@ -0,0 +1,82 @@
-+/*
-+ * This program source code file is part of KiCad, a free EDA CAD application.
-+ *
-+ * Copyright (C) 2015 Mark Roszko <mark.ros...@gmail.com>
-+ * Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 3
-+ * of the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, you may find one here:
-+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-+ * or you may search the http://www.gnu.org website for the version 2 license,
-+ * or you may write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-+ */
-+#ifndef KICAD_CURL_H_
-+#define KICAD_CURL_H_
-+
-+/*
-+ * KICAD_CURL.h must be included before wxWidgets because on Windows,
-+ * wxWidgets ends up including windows.h before winsocks2.h inside curl
-+ * this causes build warnings
-+ * Because we are before wx, we must explicitly define we are building with 
unicode.
-+ * wxWidgets defaults to supporting unicode now, so this should be safe.
-+ */
-+#if defined(WIN32)
-+    #ifndef UNICODE
-+    #    define UNICODE
-+    #endif
-+
-+    #ifndef _UNICODE
-+    #    define _UNICODE
-+    #endif
-+#endif
-+
-+#include <curl/curl.h>
-+#include <string>
-+
-+/**
-+ * Class KICAD_CURL
-+ * simple wrapper class to call curl_global_init and curl_global_cleanup for 
KiCad.
-+ */
-+class KICAD_CURL
-+{
-+public:
-+    /**
-+     * Function Init
-+     * calls curl_global_init for the application. It must be used only once
-+     * and before any curl functions that perform requests.
-+     *
-+     * @return bool - True if successful, false if CURL returned an error
-+     */
-+    static bool Init();
-+
-+    /**
-+     * Function Cleanup
-+     * calls curl_global_cleanup for the application. It must be used only 
after
-+     * curl_global_init was called.
-+     */
-+    static void Cleanup();
-+
-+    /**
-+     * Function GetVersion
-+     * wrapper for curl_version(). Reports back a short string of loaded 
libraries.
-+     *
-+     * @return std::string - String reported by libcurl
-+     */
-+    static std::string GetVersion();
-+
-+private:
-+    static bool m_initialized;
-+};
-+
-+#endif // KICAD_CURL_H_
-\ No newline at end of file
-diff --git a/include/kicad_curl/kicad_curl_easy.h 
b/include/kicad_curl/kicad_curl_easy.h
-new file mode 100644
-index 00000000..a87c3d02
---- /dev/null
-+++ b/include/kicad_curl/kicad_curl_easy.h
-@@ -0,0 +1,166 @@
-+/*
-+ * This program source code file is part of KiCad, a free EDA CAD application.
-+ *
-+ * Copyright (C) 2015 Mark Roszko <mark.ros...@gmail.com>
-+ * Copyright (C) 2015 KiCad Developers, see CHANGELOG.TXT for contributors.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 3
-+ * of the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, you may find one here:
-+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-+ * or you may search the http://www.gnu.org website for the version 2 license,
-+ * or you may write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-+ */
-+#ifndef KICAD_CURL_EASY_H_
-+#define KICAD_CURL_EASY_H_
-+
-+/*
-+ * KICAD_CURL_EASY.h must included before wxWidgets because on Windows,
-+ * wxWidgets ends up including windows.h before winsocks2.h inside curl
-+ * this causes build warnings 
-+ * Because we are before wx, we must explicitly define we are building with 
unicode
-+ * wxWidgets defaults to supporting unicode now, so this should be safe.
-+ */
-+#if defined(WIN32)
-+    #ifndef UNICODE
-+    #    define UNICODE
-+    #endif
-+
-+    #ifndef _UNICODE
-+    #    define _UNICODE
-+    #endif
-+#endif
-+
-+
-+#include <curl/curl.h>
-+#include <string>
-+
-+/**
-+ * Struct KICAD_EASY_CURL_BUFFER
-+ * is a struct used for storing the libcurl received data in its callbacks.
-+ * Do not use directly, KICAD_CURL_EASY uses it.
-+ */
-+struct KICAD_EASY_CURL_BUFFER
-+{
-+    char* payload;
-+    size_t size;
-+};
-+
-+
-+/**
-+ * Class KICAD_CURL_EASY
-+ * wrapper interface around the curl_easy API
-+ *
-+ * Handling of using the curl_easy API to make a request and save the 
response to
-+ * a memory buffer
-+ *
-+ * Here is a small example usage:
-+ * @code
-+ *   KICAD_CURL_EASY curl;
-+ *   curl.SetURL("http://github.com";);
-+ *   curl.SetUserAgent("KiCad-EDA");
-+ *   curl.SetHeader("Accept", "application/json");
-+ *   curl.Perform();
-+ * @endcode
-+ */
-+class KICAD_CURL_EASY
-+{
-+public:
-+    KICAD_CURL_EASY();
-+    ~KICAD_CURL_EASY();
-+
-+    /**
-+     * Function perform
-+     * equivalent to curl_easy_perform. Executes the request
-+     * that was previously setup.
-+     *
-+     * @throw IO_ERROR, if there is a CURL request error
-+     */
-+    void Perform();
-+
-+    /**
-+     * Function SetHeader
-+     * sets an arbitrary header for the HTTP(s) request.
-+     *
-+     * @param aName is the left hand side of the header, i.e. Accept without 
the colon
-+     * @param aValue is the right hand side of the header, i.e. 
application/json
-+     */
-+    void SetHeader( const std::string& aName, const std::string& aValue );
-+
-+    /**
-+     * Function SetUserAgent
-+     * sets the request user agent
-+     *
-+     * @param aAgent is the string to set for the user agent
-+     * @return bool - True if successful, false if not
-+     */
-+    bool SetUserAgent( const std::string& aAgent );
-+
-+    /**
-+     * Function SetURL
-+     * sets the request URL
-+     *
-+     * @param aURL is the URL
-+     * @return bool - True if successful, false if not
-+     */
-+    bool SetURL( const std::string& aURL );
-+
-+    /**
-+     * Function SetFollowRedirects
-+     * enables the following of HTTP(s) and other redirects, by default curl
-+     * does not follow redirects.
-+     *
-+     * @param aFollow is a boolean where true will enable following redirects
-+     * @return bool - True if successful, false if not
-+     */
-+    bool SetFollowRedirects( bool aFollow );
-+
-+    /**
-+     * Function GetErrorText
-+     * fetches CURL's "friendly" error string for a given error code
-+     *
-+     * @param aCode is CURL error code
-+     * @return std::string - the corresponding error string for the given code
-+     */
-+    std::string GetErrorText( CURLcode aCode );
-+
-+    /**
-+     * Function SetOption
-+     * sets a curl option, only supports single parameter curl options
-+     *
-+     * @param aOption is CURL option, see CURL manual for options
-+     * @param aArg is the argument being passed to CURL, ensure it is the 
right type per manual
-+     * @return CURLcode - CURL error code, will return CURLE_OK unless a 
problem was encountered
-+     */
-+    template <typename T> CURLcode SetOption( CURLoption aOption, T aArg ) 
-+    { 
-+        return curl_easy_setopt( m_CURL, aOption, aArg ); 
-+    }
-+
-+    /**
-+     * Function GetBuffer
-+     * returns a const pointer to the data buffer
-+     *
-+     * @return KICAD_EASY_CURL_BUFFER* - pointer to buffer
-+     */
-+    const KICAD_EASY_CURL_BUFFER* GetBuffer()
-+    {
-+        return &m_Buffer;
-+    }
-+private:
-+    CURL *m_CURL;
-+    struct curl_slist *m_headers;
-+    struct KICAD_EASY_CURL_BUFFER m_Buffer;
-+};
-+
-+#endif // KICAD_CURL_EASY_H_
-\ No newline at end of file
-diff --git a/pcbnew/github/CMakeLists.txt b/pcbnew/github/CMakeLists.txt
-index d630c69a..bb37ebf5 100644
---- a/pcbnew/github/CMakeLists.txt
-+++ b/pcbnew/github/CMakeLists.txt
-@@ -20,38 +20,14 @@
- #  or you may write to the Free Software Foundation, Inc.,
- #  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
- 
--
--
--# Download avhttp and install the headers, not actually compiled
--#################################################
--include( download_avhttp )
--
--if( MINGW AND NOT OPENSSL_ROOT_DIR )
--    # download, compile and install to scratch dir a recent OPENSSL library 
and headers
--    include( download_openssl )
--else()
--    find_package( OpenSSL REQUIRED )
--    #message( STATUS "OPENSSL_FOUND:${OPENSSL_FOUND}  
OPENSSL_LIBRARIES:${OPENSSL_LIBRARIES}" )
--
--    # FindOpenSSL.cmake does not set this var into cache, so is not globally 
visible,
--    # do it here incase some other link image needs these libraries
--    set( OPENSSL_LIBRARIES   "${OPENSSL_LIBRARIES}"   CACHE FILEPATH "OpenSSL 
link libraries" )
--    set( OPENSSL_INCLUDE_DIR "${OPENSSL_INCLUDE_DIR}" CACHE FILEPATH "OpenSSL 
include dir" )
--endif()
--
--
- # These are additions to any inherited from pcbnew dir:
--include_directories( . ${OPENSSL_INCLUDE_DIR} ${AVHTTP_INCLUDE_DIR} )
-+include_directories( . )
- 
- # Tell AVHTTP we have SSL.
--add_definitions( -DAVHTTP_ENABLE_OPENSSL )
--
--# tone down the compiler warnings for avhttp header library:
--set( CMAKE_CXX_FLAGS
--    "${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-unused-variable 
-Wno-unused-function -Wno-strict-aliasing" )
--
- set( GITHUB_PLUGIN_SRCS
--    github_plugin.cpp github_getliblist.cpp html_link_parser.cpp
-+    github_plugin.cpp 
-+    github_getliblist.cpp
-+    html_link_parser.cpp
-     )
- 
- add_library( github_plugin STATIC ${GITHUB_PLUGIN_SRCS} )
-@@ -59,7 +35,7 @@ add_library( github_plugin STATIC ${GITHUB_PLUGIN_SRCS} )
- # No, you don't get github without boost and openssl. Boost_LIBRARIES now 
moved up
- # into CMakeLists.txt for pcbnew and cvpcb:
- target_link_libraries( github_plugin
--    ${OPENSSL_LIBRARIES}
-+    common
-     )
- 
- if( MINGW )
-@@ -70,9 +46,4 @@ if( MINGW )
- endif()
- 
- add_dependencies( github_plugin boost )
--add_dependencies( github_plugin avhttp )
--
--if( MINGW AND NOT OPENSSL_ROOT_DIR )
--    add_dependencies( github_plugin openssl )
--endif()
- 
-diff --git a/pcbnew/github/github_getliblist.cpp 
b/pcbnew/github/github_getliblist.cpp
-index 00fcaca2..baf5f7c2 100644
---- a/pcbnew/github/github_getliblist.cpp
-+++ b/pcbnew/github/github_getliblist.cpp
-@@ -41,35 +41,7 @@
-  *  JP Charras.
-  */
- 
--
--#if 0
--/*
-- *  FIX ME
-- *  I do not include avhttp.hpp here, because it is already included in
-- *  github_plugin.cpp
-- *  and if it is also included in this file, the link fails (double definiton 
of modules)
-- *  therefore, the GITHUB_GETLIBLIST method which uses avhttp to download 
dats from gitub
-- *  is in github_plugin.cpp
-- */
--
--#ifndef WIN32_LEAN_AND_MEAN
--// when WIN32_LEAN_AND_MEAN is defined, some useless includes in <window.h>
--// are skipped, and this avoid some compil issues
--#define WIN32_LEAN_AND_MEAN
--#endif
--
--#ifdef WIN32
--// defines needed by avhttp
--// Minimal Windows version is XP: Google for _WIN32_WINNT
-- #define _WIN32_WINNT   0x0501
-- #define WINVER         0x0501
--#endif
--
--#include <wx/wx.h>
--#include <avhttp.hpp>
--
--#endif
--
-+#include <kicad_curl/kicad_curl_easy.h> /* Include before any wx file */
- #include <wx/uri.h>
- 
- #include <github_getliblist.h>
-@@ -97,7 +69,7 @@ bool GITHUB_GETLIBLIST::Get3DshapesLibsList( wxArrayString* 
aList,
-     wxString errorMsg;
- 
-     fullURLCommand = repoURL.utf8_str();
--    bool success = remote_get_json( &fullURLCommand, &errorMsg );
-+    bool success = remoteGetJSON( fullURLCommand, &errorMsg );
- 
-     if( !success )
-     {
-@@ -147,7 +119,7 @@ bool GITHUB_GETLIBLIST::GetFootprintLibraryList( 
wxArrayString& aList )
- 
-     while( 1 )
-     {
--        bool success = remote_get_json( &fullURLCommand, &errorMsg );
-+        bool success = remoteGetJSON( fullURLCommand, &errorMsg );
- 
-         if( !success )
-         {
-@@ -235,3 +207,37 @@ bool GITHUB_GETLIBLIST::repoURL2listURL( const wxString& 
aRepoURL,
- 
-     return false;
- }
-+
-+
-+bool GITHUB_GETLIBLIST::remoteGetJSON( const std::string& aFullURLCommand, 
wxString* aMsgError )
-+{
-+    KICAD_CURL_EASY kcurl;
-+    
-+    wxLogDebug( wxT( "Attempting to download: " ) + aFullURLCommand );
-+
-+    kcurl.SetURL(aFullURLCommand);
-+    kcurl.SetUserAgent("KiCad-EDA");
-+    kcurl.SetHeader("Accept", m_option_string);
-+    kcurl.SetFollowRedirects(true);
-+
-+    try
-+    {
-+        kcurl.Perform();
-+        m_image.assign(kcurl.GetBuffer()->payload, kcurl.GetBuffer()->size);
-+        return true;
-+    }
-+    catch( const IO_ERROR& ioe )
-+    {
-+        if( aMsgError )
-+        {
-+            UTF8 fmt( _( "Error fetching JSON data from URL '%s'.\nReason: 
'%s'" ) );
-+            
-+            std::string msg = StrPrintf( fmt.c_str(), 
-+                                         aFullURLCommand.c_str(),
-+                                         TO_UTF8( ioe.errorText ) );
-+
-+            *aMsgError = FROM_UTF8( msg.c_str() );
-+        }
-+        return false;
-+    }
-+}
-\ No newline at end of file
-diff --git a/pcbnew/github/github_getliblist.h 
b/pcbnew/github/github_getliblist.h
-index 6fd05980..0d38b8ae 100644
---- a/pcbnew/github/github_getliblist.h
-+++ b/pcbnew/github/github_getliblist.h
-@@ -103,7 +103,7 @@ protected:
-             int aItemCountMax, int aPage = 1 );
- 
-     /**
--     * Function remote_get_json
-+     * Function remoteGetJSON
-      * Download a json text from a github repo.  The text image
-      * is received into the m_input_stream.
-      * @param aFullURLCommand the full command, i.e. the url with options like
-@@ -111,7 +111,7 @@ protected:
-      * @param aMsgError a pointer to a wxString which can store an error 
message
-      * @return true if OK, false if error (which an error message in 
*aMsgError
-      */
--    bool remote_get_json( std::string* aFullURLCommand, wxString* aMsgError );
-+    bool remoteGetJSON( const std::string& aFullURLCommand, wxString* 
aMsgError );
- 
-     wxString m_github_path;     ///< Something like 
https://api.github.com/orgs/KiCad
-     std::string m_image;        ///< image of the downloaded data in its 
entirety.
-diff --git a/pcbnew/github/github_plugin.cpp b/pcbnew/github/github_plugin.cpp
-index 963a81c4..db96ae18 100644
---- a/pcbnew/github/github_plugin.cpp
-+++ b/pcbnew/github/github_plugin.cpp
-@@ -38,8 +38,7 @@ I have lost my enthusiasm for local caching until a faster 
time stamp retrieval
- mechanism can be found, or github gets more servers.  But note that the 
occasionally
- slow response is the exception rather than the norm.  Normally the response is
- down around a 1/3 of a second.  The information we would use is in the header
--named "Last-Modified" as seen below.  This would need parsing, but avhttp may
--offer some help there, if not, then boost async probably does.
-+named "Last-Modified" as seen below. 
- 
- 
- HTTP/1.1 200 OK
-@@ -64,20 +63,7 @@ X-GitHub-Request-Id: 411087C2:659E:50FD6E6:52E67F66
- Vary: Accept-Encoding
- 
- */
--
--
--#ifndef WIN32_LEAN_AND_MEAN
--// when WIN32_LEAN_AND_MEAN is defined, some useless includes in <window.h>
--// are skipped, and this avoid some compil issues
--#define WIN32_LEAN_AND_MEAN
--#endif
--
--#ifdef WIN32
-- // defines needed by avhttp
-- // Minimal Windows version is XP: Google for _WIN32_WINNT
-- #define _WIN32_WINNT   0x0501
-- #define WINVER         0x0501
--#endif
-+#include <kicad_curl/kicad_curl_easy.h> /* Include before any wx file */
- 
- #include <sstream>
- #include <boost/ptr_container/ptr_map.hpp>
-@@ -88,10 +74,6 @@ Vary: Accept-Encoding
- #include <wx/uri.h>
- 
- #include <fctsys.h>
--// Under Windows Mingw/msys, avhttp.hpp should be included after fctsys.h
--// in fact after wx/wx.h, included by fctsys.h,
--// to avoid issues (perhaps due to incompatible defines)
--#include <avhttp.hpp>                       // chinese SSL magic
- 
- #include <io_mgr.h>
- #include <richio.h>
-@@ -103,6 +85,7 @@ Vary: Accept-Encoding
- #include <fp_lib_table.h>       // ExpandSubstitutions()
- #include <github_getliblist.h>
- 
-+
- using namespace std;
- 
- 
-@@ -431,7 +414,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& 
aLibraryPath, const PROPERTIES* aP
-         m_gh_cache = new GH_CACHE();
- 
-         // INIT_LOGGER( "/tmp", "test.log" );
--        remote_get_zip( aLibraryPath );
-+        remoteGetZip( aLibraryPath );
-         // UNINIT_LOGGER();
- 
-         m_lib_path = aLibraryPath;
-@@ -460,7 +443,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& 
aLibraryPath, const PROPERTIES* aP
- }
- 
- 
--bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, string* aZipURL 
)
-+bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, std::string& 
aZipURL )
- {
-     // e.g. "https://github.com/liftoff-sr/pretty_footprints";
-     //D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );)
-@@ -470,12 +453,12 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& 
aRepoURL, string* aZipURL )
-     if( repo.HasServer() && repo.HasPath() )
-     {
-         // scheme might be "http" or if truly github.com then "https".
--        wxString zip_url = repo.GetScheme();
--
--        zip_url += "://";
-+        wxString zip_url;
- 
-         if( repo.GetServer() == "github.com" )
-         {
-+            //codeload.github.com only supports https
-+            zip_url = "https://";;
- #if 0       // A proper code path would be this one, but it is not the 
fastest.
-             zip_url += repo.GetServer();
-             zip_url += repo.GetPath();      // path comes with a leading '/'
-@@ -488,8 +471,6 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& 
aRepoURL, string* aZipURL )
- 
-             // In order to bypass this redirect, saving time, we use the
-             // redirected URL on first attempt to save one HTTP GET hit.
--            // avhttp would do the redirect behind the scenes normally, but 
that would
--            // be slower than doing this bypass.
-             zip_url += "codeload.github.com";
-             zip_url += repo.GetPath();      // path comes with a leading '/'
-             zip_url += "/zip/master";
-@@ -498,9 +479,11 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& 
aRepoURL, string* aZipURL )
- 
-         else
-         {
-+            zip_url = repo.GetScheme();
-+            zip_url += "://";
-+
-             // This is the generic code path for any server which can serve
-             // up zip files. The schemes tested include: http and https.
--            // (I don't know what the avhttp library supports beyond that.)
- 
-             // zip_url goal: "<scheme>://<server>[:<port>]/<path>"
- 
-@@ -526,126 +509,50 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& 
aRepoURL, string* aZipURL )
-             // this code path with the needs of one particular inflexible 
server.
-         }
- 
--        *aZipURL = zip_url.utf8_str();
-+        aZipURL = zip_url.utf8_str();
-         return true;
-     }
-     return false;
- }
- 
- 
--void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( 
IO_ERROR )
-+void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL ) throw( IO_ERROR )
- {
--    string  zip_url;
-+    std::string  zip_url;
- 
--    if( !repoURL_zipURL( aRepoURL, &zip_url ) )
-+    if( !repoURL_zipURL( aRepoURL, zip_url ) )
-     {
-         wxString msg = wxString::Format( _( "Unable to parse URL:\n'%s'" ), 
GetChars( aRepoURL ) );
-         THROW_IO_ERROR( msg );
-     }
- 
--    boost::asio::io_service io;
--    avhttp::http_stream     h( io );
--    avhttp::request_opts    options;
-+    wxLogDebug( wxT( "Attempting to download: " ) + zip_url );
- 
--    options.insert( "Accept",       "application/zip" );
--    options.insert( "User-Agent",   "http://kicad-pcb.org"; );   // THAT WOULD 
BE ME.
--    h.request_options( options );
-+    KICAD_CURL_EASY kcurl;
-+
-+    kcurl.SetURL(zip_url.c_str());
-+    kcurl.SetUserAgent("KiCad-EDA");
-+    kcurl.SetHeader("Accept", "application/zip");
-+    kcurl.SetFollowRedirects(true);
- 
-     try
-     {
--        ostringstream os;
--
--        h.open( zip_url );      // only one file, therefore do it 
synchronously.
--        os << &h;
--
--        // Keep zip file byte image in RAM.  That plus the MODULE_MAP will 
constitute
--        // the cache.  We don't cache the MODULEs per se, we parse those as 
needed from
--        // this zip file image.
--        m_zip_image = os.str();
--
--        // 4 lines, using SSL, top that.
-+        kcurl.Perform();
-+        m_zip_image.assign(kcurl.GetBuffer()->payload, 
kcurl.GetBuffer()->size);
-     }
--    catch( const boost::system::system_error& e )
-+    catch( const IO_ERROR& ioe )
-     {
--        // https "GET" has faild, report this to API caller.
--        static const char errorcmd[] = "http GET command failed";  // Do not 
translate this message
--
-         UTF8 fmt( _( "%s\nCannot get/download Zip archive: '%s'\nfor library 
path: '%s'.\nReason: '%s'" ) );
- 
--        string msg = StrPrintf( fmt.c_str(),
--                errorcmd,
--                // Report both secret zip_url and Lib Path, to user.  The 
secret
--                // zip_url may go bad at some point in future if github 
changes
--                // their server architecture.  Then fix repoURL_zipURL() to 
reflect
--                // new architecture.
--                zip_url.c_str(), TO_UTF8( aRepoURL ),
--                e.what() );
--
--        THROW_IO_ERROR( msg );
--    }
--    catch( const exception& exc )
--    {
--        UTF8 error( _( "Exception '%s' in avhttp while open()-ing URI:'%s'" ) 
);
-+        std::string msg = StrPrintf( fmt.c_str(), 
-+                                     zip_url.c_str(), 
-+                                     TO_UTF8( aRepoURL ),
-+                                     TO_UTF8( ioe.errorText ) );
- 
--        string msg = StrPrintf( error.c_str(), exc.what(), zip_url.c_str() );
-         THROW_IO_ERROR( msg );
-     }
- }
- 
--
--// This GITHUB_GETLIBLIST method should not be here, but in 
github_getliblist.cpp !
--// However it is here just because we need to include <avhttp.hpp> to compile 
it.
--// and when we include avhttp in two .cpp files, the link fails because it 
detects duplicate
--// avhttp functions.
--// So until it is fixed, this code is here.
--bool GITHUB_GETLIBLIST::remote_get_json( std::string* aFullURLCommand, 
wxString* aMsgError )
--{
--    boost::asio::io_service io;
--    avhttp::http_stream     h( io );
--    avhttp::request_opts    options;
--
--
--    options.insert( "Accept", m_option_string );
--    options.insert( "User-Agent", "http://kicad-pcb.org"; );   // THAT WOULD 
BE ME.
--    h.request_options( options );
--
--    try
--    {
--        std::ostringstream os;
--
--        h.open( *aFullURLCommand );      // only one file, therefore do it 
synchronously.
--        os << &h;
--
--        // Keep downloaded text file image in RAM.
--        m_image = os.str();
--
--        // 4 lines, using SSL, top that.
--    }
--    catch( boost::system::system_error& e )
--    {
--        // https "GET" has faild, report this to API caller.
--        static const char errorcmd[] = "https GET command failed";  // Do not 
translate this message
--
--        UTF8 fmt( _( "%s\nCannot get/download data from: '%s'\nReason: '%s'" 
) );
--
--        std::string msg = StrPrintf( fmt.c_str(),
--                errorcmd,
--                // Report secret list_url to user.  The secret
--                // list_url may go bad at some point in future if github 
changes
--                // their server architecture.  Then fix repoURL_zipURL() to 
reflect
--                // new architecture.
--                aFullURLCommand->c_str(), e.what() );
--
--        if( aMsgError )
--        {
--            *aMsgError = FROM_UTF8( msg.c_str() );
--            return false;
--        }
--    }
--
--    return true;
--}
--
- #if 0 && defined(STANDALONE)
- 
- int main( int argc, char** argv )
-diff --git a/pcbnew/github/github_plugin.h b/pcbnew/github/github_plugin.h
-index 4bb8248f..f930821e 100644
---- a/pcbnew/github/github_plugin.h
-+++ b/pcbnew/github/github_plugin.h
-@@ -210,14 +210,14 @@ protected:
-      * @param  aZipURL is where to put the zip file URL.
-      * @return bool - true if @a aRepoULR was parseable, else false
-      */
--    static bool repoURL_zipURL( const wxString& aRepoURL, std::string* 
aZipURL );
-+    static bool repoURL_zipURL( const wxString& aRepoURL, std::string& 
aZipURL );
- 
-     /**
--     * Function remote_get_zip
-+     * Function remoteGetZip
-      * fetches a zip file image from a github repo synchronously.  The byte 
image
-      * is received into the m_input_stream.
-      */
--    void remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR );
-+    void remoteGetZip( const wxString& aRepoURL ) throw( IO_ERROR );
- 
-     wxString    m_lib_path;     ///< from aLibraryPath, something like 
https://github.com/liftoff-sr/pretty_footprints
-     std::string m_zip_image;    ///< byte image of the zip file in its 
entirety.
diff --git a/debian/patches/series b/debian/patches/series
index 7d20f6ca..27a97cba 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,14 +1,8 @@
-debian-hacks/Remove-download-target-for-noAvhttp.patch
 fixes/Modifing-the-Exec-cmd-in-the-desktop-files.patch
 debian-hacks/Adding-needed-SVG-files-and-additinal-arrays.patch
 porting-kfreebsd-hurd/Fix-FTBFS-on-kFreeBSD-and-Hurd.patch
 fixes/Fix-FTBFS-with-Boost-1.61.patch
 fixes/Fixing-some-spelling-issues.patch
-fixes/Replace-the-avhttp-library-used-by-the-github-plugin-with.patch
 fixes/Add-missing-dependency-github_plugin-pcbcommon.patch
-fixes/Replace-avhttp-with-libcurl.patch
-fixes/Remove-unused-FindOpenSSL.cmake.patch
-fixes/Fix-issue-170-for-real.patch
-fixes/KiCadDocumentation.cmake-fix-install-target-for-HTML-docu.patch
 reproducibility/add-field-revdate-to-asciidoc-files-of-documentation.patch
 debian-hacks/Removing-hyphen-inside-KICAD_FULL_VERSION.patch
diff --git a/debian/rules b/debian/rules
index bf311fef..fc3c89ea 100755
--- a/debian/rules
+++ b/debian/rules
@@ -91,6 +91,8 @@ override_dh_auto_install:
        dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR)/doc 
--builddirectory=$(DEB_BUILD_DIR)/doc
        # installing KiCad i18n files
        dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR)/i18n 
--builddirectory=$(DEB_BUILD_DIR)/i18n
+       # fix permissions of libraries (if needed) before installing
+       chmod 644 $(CURDIR)/libraries/*/*.kicad_mod
        # install KiCad libraries
        dh_auto_install --destdir=$(INSTDIR) 
--sourcedirectory=$(CURDIR)/libraries/kicad-library 
--builddirectory=$(DEB_BUILD_DIR)/libraries
        # some tweaks before running the next dh sequencers
@@ -112,7 +114,7 @@ override_dh_install:
        dh_install
        dh_python2
 
-override_dh_fixperms-indep:
+override_dh_fixperms-arch:
        dh_fixperms
        # fixing file permissions for *.py files in kicad-common
        for i in `find $(CURDIR)/debian/kicad-common/usr -type f -name "*.py"`; 
do \

Regards
Carsten

Reply via email to