-
Notifications
You must be signed in to change notification settings - Fork 2
ENG-867: Introduce build script #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| patchelf (0.10-1) experimental; urgency=low | ||
|
|
||
| * Packaging for 0.10 | ||
|
|
||
| -- Illia Pshonkin <illia.pshonkin@percona.com> Mon, 25 May 2020 10:57:32 +0300 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Source: patchelf | ||
| Section: utils | ||
| Priority: optional | ||
| Maintainer: Felipe Sateler <fsateler@debian.org> | ||
| Build-Depends: debhelper (>= 9.0.0) | ||
| Standards-Version: 3.9.7 | ||
| Homepage: https://nixos.org/patchelf.html | ||
| Vcs-Git: https://salsa.debian.org/debian/patchelf.git | ||
| Vcs-Browser: https://salsa.debian.org/debian/patchelf | ||
|
|
||
| Package: patchelf | ||
| Architecture: any | ||
| Depends: ${shlibs:Depends}, ${misc:Depends} | ||
| Description: modify properties of ELF executables | ||
| PatchELF is a simple utility for modifying existing ELF executables and | ||
| libraries. In particular, it can do the following: | ||
| . | ||
| * Change the dynamic loader ("ELF interpreter") of executables | ||
| * Change the RPATH of executables and libraries | ||
| * Remove declared dependencies on dynamic libraries | ||
| (DT_NEEDED entries) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
| Upstream-Name: patchelf | ||
| Source: http://nixos.org/patchelf.html | ||
|
|
||
| Files: * | ||
| Copyright: 2004-2014 Eelco Dolstra <eelco.dolstra@logicblox.com> | ||
| License: GPL-3.0+ | ||
|
|
||
| Files: debian/* | ||
| Copyright: 2014 Felipe Sateler <fsateler@debian.org> | ||
| License: GPL-3.0+ | ||
|
|
||
| Files: src/elf.h | ||
| Copyright: 1995-2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. | ||
| License: LGPL-2.1+ | ||
|
|
||
| License: GPL-3.0+ | ||
| 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 package 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, see <http://www.gnu.org/licenses/>. | ||
| . | ||
| On Debian systems, the complete text of the GNU General | ||
| Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". | ||
|
|
||
| License: LGPL-2.1+ | ||
| This package is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public | ||
| License as published by the Free Software Foundation; either | ||
| version 2.1 of the License, or (at your option) any later version. | ||
| . | ||
| This package 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 | ||
| Lesser General Public License for more details. | ||
| . | ||
| You should have received a copy of the GNU General Public License | ||
| along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| . | ||
| On Debian systems, the complete text of the GNU Lesser General | ||
| Public License can be found in "/usr/share/common-licenses/LGPL-2.1". | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| README |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| usr/local/bin/patchelf /usr/bin | ||
| usr/local/share/* /usr/share |
35 changes: 35 additions & 0 deletions
35
debian/patches/adjust_startPage_issue127_commit1cc234fea.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| From: Ed Bartosh <ed.bartosh@linux.intel.com> | ||
| Date: Fri, 21 Jul 2017 12:33:53 +0300 | ||
| Subject: [PATCH] fix adjusting startPage | ||
|
|
||
| startPage is adjusted unconditionally for all executables. | ||
| This results in incorrect addresses assigned to INTERP and LOAD | ||
| program headers, which breaks patched executable. | ||
|
|
||
| Adjusting startPage variable only when startOffset > startPage | ||
| should fix this. | ||
|
|
||
| This change is related to the issue NixOS#10 | ||
|
|
||
| Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> | ||
| --- | ||
| src/patchelf.cc | 6 ++---- | ||
| 1 file changed, 2 insertions(+), 4 deletions(-) | ||
|
|
||
| diff --git a/src/patchelf.cc b/src/patchelf.cc | ||
| index 0b4965a..12d6bf1 100644 | ||
| --- a/src/patchelf.cc | ||
| +++ b/src/patchelf.cc | ||
| @@ -742,10 +742,8 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary() | ||
| since DYN executables tend to start at virtual address 0, so | ||
| rewriteSectionsExecutable() won't work because it doesn't have | ||
| any virtual address space to grow downwards into. */ | ||
| - if (isExecutable) { | ||
| - if (startOffset >= startPage) { | ||
| - debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); | ||
| - } | ||
| + if (isExecutable && startOffset > startPage) { | ||
| + debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage); | ||
| startPage = startOffset; | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| adjust_startPage_issue127_commit1cc234fea.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| #!/usr/bin/make -f | ||
| # -*- makefile -*- | ||
|
|
||
| # Uncomment this to turn on verbose mode. | ||
| #export DH_VERBOSE=1 | ||
|
|
||
| %: | ||
| dh $@ | ||
| TMP=$(CURDIR)/debian/tmp/ | ||
| TMPD=$(CURDIR)/debian/tmp-debug/ | ||
| prefix=/usr | ||
| ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH) | ||
| ARCH_OS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) | ||
| NCPU = $(shell grep -c processor /proc/cpuinfo) | ||
| DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | ||
| DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | ||
|
|
||
| DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':')) | ||
| DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') | ||
| DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-) | ||
| DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//') | ||
| DEB_UPSTREAM_VERSION_MAJOR_MINOR := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r -n 's/^([0-9]+\.[0-9]+).*/\1/p') | ||
| DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) | ||
|
|
||
| DISTRIBUTION = $(shell lsb_release -i -s) | ||
| DISTRELEASE = $(shell lsb_release -c -s) | ||
|
|
||
| patchelfdir = patchelf-$(VERSION) | ||
|
|
||
| override_dh_auto_configure: | ||
| @echo "RULES.$@" | ||
| ./bootstrap.sh | ||
| ./configure | ||
| make | ||
| touch $@ | ||
|
|
||
| override_dh_auto_build: | ||
| @echo "RULES.$@" | ||
| ./bootstrap.sh | ||
| ./configure | ||
| make | ||
| touch $@ | ||
|
|
||
| override_dh_auto_install: | ||
| @echo "RULES.$@" | ||
| make DESTDIR="$(TMP)" install | ||
|
|
||
| override_dh_auto_clean: | ||
| [ ! -f Makefile ] || $(MAKE) maintainer-clean | ||
| rm -rf build-aux | ||
| find . -name Makefile.in -delete | ||
| rm -f configure | ||
| rm -f aclocal.m4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.0 (quilt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| extend-diff-ignore=bootstrap.sh | ||
| extend-diff-ignore=release.nix | ||
| extend-diff-ignore=version | ||
| extend-diff-ignore=BUGS | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| version=4 | ||
| opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%patchelf-$1.tar.gz%" \ | ||
| https://github.com/NixOS/patchelf/tags \ | ||
| (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| Summary: A utility for patching ELF binaries | ||
|
|
||
| Name: patchelf | ||
| Version: @PACKAGE_VERSION@ | ||
| Release: 1 | ||
| License: GPL | ||
| Group: Development/Tools | ||
| URL: http://nixos.org/patchelf.html | ||
| Source0: %{name}-%{version}.tar.gz | ||
| Patch0: adjust_startPage_issue127_commit1cc234fea.patch | ||
| BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot | ||
| Prefix: /usr | ||
|
|
||
| %description | ||
|
|
||
| PatchELF is a simple utility for modifing existing ELF executables and | ||
| libraries. It can change the dynamic loader ("ELF interpreter") of | ||
| executables and change the RPATH of executables and libraries. | ||
|
|
||
| %prep | ||
| %setup -q | ||
| %patch0 -p1 | ||
|
|
||
| %build | ||
| %if 0%{?rhel} == 6 | ||
| sed -i "s: serial-tests::g" configure.ac | ||
| %endif | ||
| ./bootstrap.sh | ||
| ./configure --prefix=%{_prefix} | ||
| make | ||
| make check | ||
|
|
||
| %install | ||
| rm -rf $RPM_BUILD_ROOT | ||
| make DESTDIR=$RPM_BUILD_ROOT install | ||
| # rpmbuild automatically strips... strip $RPM_BUILD_ROOT/%%{_bindir}/* || true | ||
|
|
||
| %clean | ||
| rm -rf $RPM_BUILD_ROOT | ||
|
|
||
| %files | ||
| %{_bindir}/patchelf | ||
| %doc %{_docdir}/patchelf/README | ||
| %{_mandir}/man1/patchelf.1.gz | ||
|
|
||
| %changelog | ||
| * Wed May 27 2020 Illia Pshonkin <illia.pshonkin@percona.com> | ||
| - Packaging for 0.10 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.