]> git.proxmox.com Git - ceph.git/blob - ceph/src/pmdk/utils/build-dpkg.sh
import ceph 16.2.7
[ceph.git] / ceph / src / pmdk / utils / build-dpkg.sh
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2014-2020, Intel Corporation
4
5 #
6 # build-dpkg.sh - Script for building deb packages
7 #
8
9 set -e
10
11 SCRIPT_DIR=$(dirname $0)
12 source $SCRIPT_DIR/pkg-common.sh
13
14 #
15 # usage -- print usage message and exit
16 #
17 usage()
18 {
19 [ "$1" ] && echo Error: $1
20 cat >&2 <<EOF
21 Usage: $0 [ -h ] -t version-tag -s source-dir -w working-dir -o output-dir
22 [ -e build-experimental ] [ -c run-check ]
23 [ -n with-ndctl ] [ -f testconfig-file ]
24
25 -h print this help message
26 -t version-tag source version tag
27 -s source-dir source directory
28 -w working-dir working directory
29 -o output-dir output directory
30 -e build-experimental build experimental packages
31 -c run-check run package check
32 -n with-ndctl build with libndctl
33 -f testconfig-file custom testconfig.sh
34 EOF
35 exit 1
36 }
37
38 #
39 # command-line argument processing...
40 #
41 args=`getopt he:c:r:n:t:d:s:w:o:f: $*`
42 [ $? != 0 ] && usage
43 set -- $args
44 for arg
45 do
46 receivetype=auto
47 case "$arg"
48 in
49 -e)
50 EXPERIMENTAL="$2"
51 shift 2
52 ;;
53 -c)
54 BUILD_PACKAGE_CHECK="$2"
55 shift 2
56 ;;
57 -f)
58 TEST_CONFIG_FILE="$2"
59 shift 2
60 ;;
61 -r)
62 BUILD_RPMEM="$2"
63 shift 2
64 ;;
65 -n)
66 NDCTL_ENABLE="$2"
67 shift 2
68 ;;
69 -t)
70 PACKAGE_VERSION_TAG="$2"
71 shift 2
72 ;;
73 -s)
74 SOURCE="$2"
75 shift 2
76 ;;
77 -w)
78 WORKING_DIR="$2"
79 shift 2
80 ;;
81 -o)
82 OUT_DIR="$2"
83 shift 2
84 ;;
85 --)
86 shift
87 break
88 ;;
89 esac
90 done
91
92 # check for mandatory arguments
93 if [ -z "$PACKAGE_VERSION_TAG" -o -z "$SOURCE" -o -z "$WORKING_DIR" -o -z "$OUT_DIR" ]
94 then
95 error "Mandatory arguments missing"
96 usage
97 fi
98
99 PMEM2_INSTALL="y"
100
101 PREFIX=usr
102 LIB_DIR=$PREFIX/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
103 INC_DIR=$PREFIX/include
104 MAN1_DIR=$PREFIX/share/man/man1
105 MAN3_DIR=$PREFIX/share/man/man3
106 MAN5_DIR=$PREFIX/share/man/man5
107 MAN7_DIR=$PREFIX/share/man/man7
108
109 DOC_DIR=$PREFIX/share/doc
110 if [ "$EXTRA_CFLAGS_RELEASE" = "" ]; then
111 export EXTRA_CFLAGS_RELEASE="-ggdb -fno-omit-frame-pointer"
112 fi
113
114 LIBFABRIC_MIN_VERSION=1.4.2
115 NDCTL_MIN_VERSION=60.1
116
117 function convert_changelog() {
118 while read line
119 do
120 if [[ $line =~ $REGEX_DATE_AUTHOR ]]
121 then
122 DATE="${BASH_REMATCH[1]}"
123 AUTHOR="${BASH_REMATCH[2]}"
124 echo " * ${DATE} ${AUTHOR}"
125 elif [[ $line =~ $REGEX_MESSAGE_START ]]
126 then
127 MESSAGE="${BASH_REMATCH[1]}"
128 echo " - ${MESSAGE}"
129 elif [[ $line =~ $REGEX_MESSAGE ]]
130 then
131 MESSAGE="${BASH_REMATCH[1]}"
132 echo " ${MESSAGE}"
133 fi
134 done < $1
135 }
136
137 function rpmem_install_triggers_overrides() {
138 cat << EOF > debian/librpmem.install
139 $LIB_DIR/librpmem.so.*
140 EOF
141
142 cat << EOF > debian/librpmem.lintian-overrides
143 $ITP_BUG_EXCUSE
144 new-package-should-close-itp-bug
145 librpmem: package-name-doesnt-match-sonames
146 EOF
147
148 cat << EOF > debian/librpmem-dev.install
149 $LIB_DIR/pmdk_debug/librpmem.a $LIB_DIR/pmdk_dbg/
150 $LIB_DIR/pmdk_debug/librpmem.so $LIB_DIR/pmdk_dbg/
151 $LIB_DIR/pmdk_debug/librpmem.so.* $LIB_DIR/pmdk_dbg/
152 $LIB_DIR/librpmem.so
153 $LIB_DIR/pkgconfig/librpmem.pc
154 $INC_DIR/librpmem.h
155 $MAN7_DIR/librpmem.7
156 $MAN3_DIR/rpmem_*.3
157 EOF
158
159 cat << EOF > debian/librpmem-dev.triggers
160 interest man-db
161 EOF
162
163 cat << EOF > debian/librpmem-dev.lintian-overrides
164 $ITP_BUG_EXCUSE
165 new-package-should-close-itp-bug
166 # The following warnings are triggered by a bug in debhelper:
167 # https://bugs.debian.org/204975
168 postinst-has-useless-call-to-ldconfig
169 postrm-has-useless-call-to-ldconfig
170 # We do not want to compile with -O2 for debug version
171 hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
172 EOF
173
174 cat << EOF > debian/rpmemd.install
175 usr/bin/rpmemd
176 $MAN1_DIR/rpmemd.1
177 EOF
178
179 cat << EOF > debian/rpmemd.triggers
180 interest man-db
181 EOF
182
183 cat << EOF > debian/rpmemd.lintian-overrides
184 $ITP_BUG_EXCUSE
185 new-package-should-close-itp-bug
186 EOF
187 }
188
189 function append_rpmem_control() {
190 cat << EOF >> $CONTROL_FILE
191
192 Package: librpmem
193 Architecture: any
194 Depends: \${shlibs:Depends}, \${misc:Depends}
195 Description: Persistent Memory remote access support library
196 librpmem provides low-level support for remote access to persistent memory
197 (pmem) utilizing RDMA-capable RNICs. The library can be used to replicate
198 remotely a memory region over RDMA protocol. It utilizes appropriate
199 persistency mechanism based on remote node’s platform capabilities. The
200 librpmem utilizes the ssh client to authenticate a user on remote node and for
201 encryption of connection’s out-of-band configuration data.
202 .
203 This library is for applications that use remote persistent memory directly,
204 without the help of any library-supplied transactions or memory allocation.
205 Higher-level libraries that build on libpmem are available and are recommended
206 for most applications.
207
208 Package: librpmem-dev
209 Section: libdevel
210 Architecture: any
211 Depends: librpmem (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
212 Description: Development files for librpmem
213 librpmem provides low-level support for remote access to persistent memory
214 (pmem) utilizing RDMA-capable RNICs.
215 .
216 This package contains libraries and header files used for linking programs
217 against librpmem.
218
219 Package: rpmemd
220 Section: misc
221 Architecture: any
222 Priority: optional
223 Depends: \${shlibs:Depends}, \${misc:Depends}
224 Description: rpmem daemon
225 Daemon for Remote Persistent Memory support.
226 EOF
227 }
228
229 function libpmem2_install_triggers_overrides() {
230 cat << EOF > debian/libpmem2.install
231 $LIB_DIR/libpmem2.so.*
232 EOF
233
234 cat << EOF > debian/libpmem2.lintian-overrides
235 $ITP_BUG_EXCUSE
236 new-package-should-close-itp-bug
237 libpmem2: package-name-doesnt-match-sonames
238 EOF
239
240 cat << EOF > debian/libpmem2-dev.install
241 $LIB_DIR/pmdk_debug/libpmem2.a $LIB_DIR/pmdk_dbg/
242 $LIB_DIR/pmdk_debug/libpmem2.so $LIB_DIR/pmdk_dbg/
243 $LIB_DIR/pmdk_debug/libpmem2.so.* $LIB_DIR/pmdk_dbg/
244 $LIB_DIR/libpmem2.so
245 $LIB_DIR/pkgconfig/libpmem2.pc
246 $INC_DIR/libpmem2.h
247 $MAN7_DIR/libpmem2.7
248 $MAN3_DIR/pmem2_*.3
249 EOF
250
251 cat << EOF > debian/libpmem2-dev.triggers
252 interest man-db
253 EOF
254
255 cat << EOF > debian/libpmem2-dev.lintian-overrides
256 $ITP_BUG_EXCUSE
257 new-package-should-close-itp-bug
258 # The following warnings are triggered by a bug in debhelper:
259 # https://bugs.debian.org/204975
260 postinst-has-useless-call-to-ldconfig
261 postrm-has-useless-call-to-ldconfig
262 # We do not want to compile with -O2 for debug version
263 hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
264 EOF
265 }
266
267 function append_libpmem2_control() {
268 cat << EOF >> $CONTROL_FILE
269
270 Package: libpmem2
271 Architecture: any
272 Depends: \${shlibs:Depends}, \${misc:Depends}
273 Description: Persistent Memory low level support library
274 libpmem2 provides low level persistent memory support. In particular, support
275 for the persistent memory instructions for flushing changes to pmem is
276 provided.
277
278 Package: libpmem2-dev
279 Section: libdevel
280 Architecture: any
281 Depends: libpmem2 (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
282 Description: Development files for libpmem2
283 libpmem2 provides low level persistent memory support. In particular, support
284 for the persistent memory instructions for flushing changes to pmem is
285 provided.
286 EOF
287 }
288
289 function daxio_install_triggers_overrides() {
290 cat << EOF > debian/daxio.install
291 usr/bin/daxio
292 $MAN1_DIR/daxio.1
293 EOF
294
295 cat << EOF > debian/daxio.triggers
296 interest man-db
297 EOF
298
299 cat << EOF > debian/daxio.lintian-overrides
300 $ITP_BUG_EXCUSE
301 new-package-should-close-itp-bug
302 EOF
303 }
304
305 function append_daxio_control() {
306 cat << EOF >> $CONTROL_FILE
307
308 Package: daxio
309 Section: misc
310 Architecture: any
311 Priority: optional
312 Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
313 Description: dd-like tool to read/write to a devdax device
314 The daxio utility performs I/O on Device DAX devices or zeroes a Device
315 DAX device. Since the standard I/O APIs (read/write) cannot be used
316 with Device DAX, data transfer is performed on a memory-mapped device.
317 The daxio may be used to dump Device DAX data to a file, restore data from
318 a backup copy, move/copy data to another device or to erase data from
319 a device.
320 EOF
321 }
322
323 if [ "${BUILD_PACKAGE_CHECK}" == "y" ]
324 then
325 CHECK_CMD="
326 override_dh_auto_test:
327 dh_auto_test
328 if [ -f $TEST_CONFIG_FILE ]; then\
329 cp $TEST_CONFIG_FILE src/test/testconfig.sh;\
330 else\
331 echo 'PMEM_FS_DIR=/tmp' > src/test/testconfig.sh; \
332 echo 'PMEM_FS_DIR_FORCE_PMEM=1' >> src/test/testconfig.sh; \
333 echo 'TEST_BUILD=\"debug nondebug\"' >> src/test/testconfig.sh; \
334 echo 'TEST_FS=\"pmem any none\"' >> src/test/testconfig.sh; \
335 fi
336 make pcheck ${PCHECK_OPTS}
337 "
338 else
339 CHECK_CMD="
340 override_dh_auto_test:
341
342 "
343 fi
344
345 check_tool debuild
346 check_tool dch
347 check_file $SCRIPT_DIR/pkg-config.sh
348
349 source $SCRIPT_DIR/pkg-config.sh
350
351 PACKAGE_VERSION=$(get_version $PACKAGE_VERSION_TAG)
352 PACKAGE_RELEASE=1
353 PACKAGE_SOURCE=${PACKAGE_NAME}-${PACKAGE_VERSION}
354 PACKAGE_TARBALL_ORIG=${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.gz
355 MAGIC_INSTALL=utils/magic-install.sh
356 MAGIC_UNINSTALL=utils/magic-uninstall.sh
357 CONTROL_FILE=debian/control
358
359 [ -d $WORKING_DIR ] || mkdir $WORKING_DIR
360 [ -d $OUT_DIR ] || mkdir $OUT_DIR
361
362 OLD_DIR=$PWD
363
364 cd $WORKING_DIR
365
366 check_dir $SOURCE
367
368 mv $SOURCE $PACKAGE_SOURCE
369 tar zcf $PACKAGE_TARBALL_ORIG $PACKAGE_SOURCE
370
371 cd $PACKAGE_SOURCE
372
373 rm -rf debian
374 mkdir debian
375
376 # Generate compat file
377 cat << EOF > debian/compat
378 9
379 EOF
380
381 # Generate control file
382 cat << EOF > $CONTROL_FILE
383 Source: $PACKAGE_NAME
384 Maintainer: $PACKAGE_MAINTAINER
385 Section: libs
386 Priority: optional
387 Standards-version: 4.1.4
388 Build-Depends: debhelper (>= 9)
389 Homepage: https://pmem.io/pmdk/
390
391 Package: libpmem
392 Architecture: any
393 Depends: \${shlibs:Depends}, \${misc:Depends}
394 Description: Persistent Memory low level support library
395 libpmem provides low level persistent memory support. In particular, support
396 for the persistent memory instructions for flushing changes to pmem is
397 provided.
398
399 Package: libpmem-dev
400 Section: libdevel
401 Architecture: any
402 Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
403 Description: Development files for libpmem
404 libpmem provides low level persistent memory support. In particular, support
405 for the persistent memory instructions for flushing changes to pmem is
406 provided.
407
408 Package: libpmemblk
409 Architecture: any
410 Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
411 Description: Persistent Memory block array support library
412 libpmemblk implements a pmem-resident array of blocks, all the same size, where
413 a block is updated atomically with respect to power failure or program
414 interruption (no torn blocks).
415
416 Package: libpmemblk-dev
417 Section: libdevel
418 Architecture: any
419 Depends: libpmemblk (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
420 Description: Development files for libpmemblk
421 libpmemblk implements a pmem-resident array of blocks, all the same size, where
422 a block is updated atomically with respect to power failure or program
423 interruption (no torn blocks).
424
425 Package: libpmemlog
426 Architecture: any
427 Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
428 Description: Persistent Memory log file support library
429 libpmemlog implements a pmem-resident log file.
430
431 Package: libpmemlog-dev
432 Section: libdevel
433 Architecture: any
434 Depends: libpmemlog (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
435 Description: Development files for libpmemlog
436 libpmemlog implements a pmem-resident log file.
437
438 Package: libpmemobj
439 Architecture: any
440 Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
441 Description: Persistent Memory object store support library
442 libpmemobj turns a persistent memory file into a flexible object store,
443 supporting transactions, memory management, locking, lists, and a number of
444 other features.
445
446 Package: libpmemobj-dev
447 Section: libdevel
448 Architecture: any
449 Depends: libpmemobj (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
450 Description: Development files for libpmemobj
451 libpmemobj turns a persistent memory file into a flexible object store,
452 supporting transactions, memory management, locking, lists, and a number of
453 other features.
454 .
455 This package contains libraries and header files used for linking programs
456 against libpmemobj.
457
458 Package: libpmempool
459 Architecture: any
460 Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
461 Description: Persistent Memory pool management support library
462 libpmempool provides a set of utilities for management, diagnostics and repair
463 of persistent memory pools. A pool in this context means a pmemobj pool,
464 pmemblk pool, pmemlog pool or BTT layout, independent of the underlying
465 storage. The libpmempool is for applications that need high reliability or
466 built-in troubleshooting. It may be useful for testing and debugging purposes
467 also.
468
469 Package: libpmempool-dev
470 Section: libdevel
471 Architecture: any
472 Depends: libpmempool (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
473 Description: Development files for libpmempool
474 libpmempool provides a set of utilities for management, diagnostics and repair
475 of persistent memory pools.
476 .
477 This package contains libraries and header files used for linking programs
478 against libpmempool.
479
480 Package: $PACKAGE_NAME-dbg
481 Section: debug
482 Priority: optional
483 Architecture: any
484 Depends: libpmem (=\${binary:Version}), libpmemblk (=\${binary:Version}), libpmemlog (=\${binary:Version}), libpmemobj (=\${binary:Version}), libpmempool (=\${binary:Version}), \${misc:Depends}
485 Description: Debug symbols for PMDK libraries
486 Debug symbols for all PMDK libraries.
487
488 Package: pmempool
489 Section: misc
490 Architecture: any
491 Priority: optional
492 Depends: \${shlibs:Depends}, \${misc:Depends}
493 Description: utility for management and off-line analysis of PMDK memory pools
494 This utility is a standalone tool that manages Persistent Memory pools
495 created by PMDK libraries. It provides a set of utilities for
496 administration and diagnostics of Persistent Memory pools. Pmempool may be
497 useful for troubleshooting by system administrators and users of the
498 applications based on PMDK libraries.
499
500 Package: pmreorder
501 Section: misc
502 Architecture: any
503 Priority: optional
504 Depends: \${shlibs:Depends}, \${misc:Depends}
505 Description: tool to parse and replay pmemcheck logs
506 Pmreorder is tool that parses and replays log of operations collected by
507 pmemcheck -- a atandalone tool which is a collection of python scripts designed
508 to parse and replay operations logged by pmemcheck - a persistent memory
509 checking tool. Pmreorder performs the store reordering between persistent
510 memory barriers - a sequence of flush-fence operations. It uses a
511 consistency checking routine provided in the command line options to check
512 whether files are in a consistent state.
513 EOF
514
515 cp LICENSE debian/copyright
516
517 if [ -n "$NDCTL_ENABLE" ]; then
518 pass_ndctl_enable="NDCTL_ENABLE=$NDCTL_ENABLE"
519 else
520 pass_ndctl_enable=""
521 fi
522
523 cat << EOF > debian/rules
524 #!/usr/bin/make -f
525 #export DH_VERBOSE=1
526 %:
527 dh \$@
528
529 override_dh_strip:
530 dh_strip --dbg-package=$PACKAGE_NAME-dbg
531
532 override_dh_auto_build:
533 dh_auto_build -- EXPERIMENTAL=${EXPERIMENTAL} prefix=/$PREFIX libdir=/$LIB_DIR includedir=/$INC_DIR docdir=/$DOC_DIR man1dir=/$MAN1_DIR man3dir=/$MAN3_DIR man5dir=/$MAN5_DIR man7dir=/$MAN7_DIR sysconfdir=/etc bashcompdir=/usr/share/bash-completion/completions NORPATH=1 ${pass_ndctl_enable} SRCVERSION=$SRCVERSION PMEM2_INSTALL=${PMEM2_INSTALL}
534
535 override_dh_auto_install:
536 dh_auto_install -- EXPERIMENTAL=${EXPERIMENTAL} prefix=/$PREFIX libdir=/$LIB_DIR includedir=/$INC_DIR docdir=/$DOC_DIR man1dir=/$MAN1_DIR man3dir=/$MAN3_DIR man5dir=/$MAN5_DIR man7dir=/$MAN7_DIR sysconfdir=/etc bashcompdir=/usr/share/bash-completion/completions NORPATH=1 ${pass_ndctl_enable} SRCVERSION=$SRCVERSION PMEM2_INSTALL=${PMEM2_INSTALL}
537 find -path './debian/*usr/share/man/man*/*.gz' -exec gunzip {} \;
538
539 override_dh_install:
540 mkdir -p debian/tmp/usr/share/pmdk/
541 cp utils/pmdk.magic debian/tmp/usr/share/pmdk/
542 dh_install
543
544 ${CHECK_CMD}
545 EOF
546
547 chmod +x debian/rules
548
549 mkdir debian/source
550
551 ITP_BUG_EXCUSE="# This is our first package but we do not want to upload it yet.
552 # Please refer to Debian Developer's Reference section 5.1 (New packages) for details:
553 # https://www.debian.org/doc/manuals/developers-reference/pkgs.html#newpackage"
554
555 cat << EOF > debian/source/format
556 3.0 (quilt)
557 EOF
558
559 cat << EOF > debian/libpmem.install
560 $LIB_DIR/libpmem.so.*
561 usr/share/pmdk/pmdk.magic
562 $MAN5_DIR/poolset.5
563 EOF
564
565 cat $MAGIC_INSTALL > debian/libpmem.postinst
566 sed -i '1s/.*/\#\!\/bin\/bash/' debian/libpmem.postinst
567 echo $'\n#DEBHELPER#\n' >> debian/libpmem.postinst
568 cat $MAGIC_UNINSTALL > debian/libpmem.prerm
569 sed -i '1s/.*/\#\!\/bin\/bash/' debian/libpmem.prerm
570 echo $'\n#DEBHELPER#\n' >> debian/libpmem.prerm
571
572 cat << EOF > debian/libpmem.lintian-overrides
573 $ITP_BUG_EXCUSE
574 new-package-should-close-itp-bug
575 libpmem: package-name-doesnt-match-sonames
576 EOF
577
578 cat << EOF > debian/libpmem-dev.install
579 $LIB_DIR/pmdk_debug/libpmem.a $LIB_DIR/pmdk_dbg/
580 $LIB_DIR/pmdk_debug/libpmem.so $LIB_DIR/pmdk_dbg/
581 $LIB_DIR/pmdk_debug/libpmem.so.* $LIB_DIR/pmdk_dbg/
582 $LIB_DIR/libpmem.so
583 $LIB_DIR/pkgconfig/libpmem.pc
584 $INC_DIR/libpmem.h
585 $MAN7_DIR/libpmem.7
586 $MAN3_DIR/pmem_*.3
587 EOF
588
589 cat << EOF > debian/libpmem-dev.lintian-overrides
590 $ITP_BUG_EXCUSE
591 new-package-should-close-itp-bug
592 # The following warnings are triggered by a bug in debhelper:
593 # https://bugs.debian.org/204975
594 postinst-has-useless-call-to-ldconfig
595 postrm-has-useless-call-to-ldconfig
596 # We do not want to compile with -O2 for debug version
597 hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
598 # pmdk provides second set of libraries for debugging.
599 # These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
600 # Related issue: https://github.com/pmem/issues/issues/841
601 libpmem-dev: package-has-unnecessary-activation-of-ldconfig-trigger
602
603 EOF
604
605 cat << EOF > debian/libpmemblk.install
606 $LIB_DIR/libpmemblk.so.*
607 EOF
608
609 cat << EOF > debian/libpmemblk.lintian-overrides
610 $ITP_BUG_EXCUSE
611 new-package-should-close-itp-bug
612 libpmemblk: package-name-doesnt-match-sonames
613 EOF
614
615 cat << EOF > debian/libpmemblk-dev.install
616 $LIB_DIR/pmdk_debug/libpmemblk.a $LIB_DIR/pmdk_dbg/
617 $LIB_DIR/pmdk_debug/libpmemblk.so $LIB_DIR/pmdk_dbg/
618 $LIB_DIR/pmdk_debug/libpmemblk.so.* $LIB_DIR/pmdk_dbg/
619 $LIB_DIR/libpmemblk.so
620 $LIB_DIR/pkgconfig/libpmemblk.pc
621 $INC_DIR/libpmemblk.h
622 $MAN7_DIR/libpmemblk.7
623 $MAN3_DIR/pmemblk_*.3
624 EOF
625
626 cat << EOF > debian/libpmemblk-dev.lintian-overrides
627 $ITP_BUG_EXCUSE
628 new-package-should-close-itp-bug
629 # The following warnings are triggered by a bug in debhelper:
630 # https://bugs.debian.org/204975
631 postinst-has-useless-call-to-ldconfig
632 postrm-has-useless-call-to-ldconfig
633 # We do not want to compile with -O2 for debug version
634 hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
635 # pmdk provides second set of libraries for debugging.
636 # These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
637 # Related issue: https://github.com/pmem/issues/issues/841
638 libpmemblk-dev: package-has-unnecessary-activation-of-ldconfig-trigger
639 EOF
640
641 cat << EOF > debian/libpmemlog.install
642 $LIB_DIR/libpmemlog.so.*
643 EOF
644
645 cat << EOF > debian/libpmemlog.lintian-overrides
646 $ITP_BUG_EXCUSE
647 new-package-should-close-itp-bug
648 libpmemlog: package-name-doesnt-match-sonames
649 EOF
650
651 cat << EOF > debian/libpmemlog-dev.install
652 $LIB_DIR/pmdk_debug/libpmemlog.a $LIB_DIR/pmdk_dbg/
653 $LIB_DIR/pmdk_debug/libpmemlog.so $LIB_DIR/pmdk_dbg/
654 $LIB_DIR/pmdk_debug/libpmemlog.so.* $LIB_DIR/pmdk_dbg/
655 $LIB_DIR/libpmemlog.so
656 $LIB_DIR/pkgconfig/libpmemlog.pc
657 $INC_DIR/libpmemlog.h
658 $MAN7_DIR/libpmemlog.7
659 $MAN3_DIR/pmemlog_*.3
660 EOF
661
662 cat << EOF > debian/libpmemlog-dev.lintian-overrides
663 $ITP_BUG_EXCUSE
664 new-package-should-close-itp-bug
665 # The following warnings are triggered by a bug in debhelper:
666 # https://bugs.debian.org/204975
667 postinst-has-useless-call-to-ldconfig
668 postrm-has-useless-call-to-ldconfig
669 # We do not want to compile with -O2 for debug version
670 hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
671 # pmdk provides second set of libraries for debugging.
672 # These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
673 # Related issue: https://github.com/pmem/issues/issues/841
674 libpmemlog-dev: package-has-unnecessary-activation-of-ldconfig-trigger
675 EOF
676
677 cat << EOF > debian/libpmemobj.install
678 $LIB_DIR/libpmemobj.so.*
679 EOF
680
681 cat << EOF > debian/libpmemobj.lintian-overrides
682 $ITP_BUG_EXCUSE
683 new-package-should-close-itp-bug
684 libpmemobj: package-name-doesnt-match-sonames
685 EOF
686
687 cat << EOF > debian/libpmemobj-dev.install
688 $LIB_DIR/pmdk_debug/libpmemobj.a $LIB_DIR/pmdk_dbg/
689 $LIB_DIR/pmdk_debug/libpmemobj.so $LIB_DIR/pmdk_dbg/
690 $LIB_DIR/pmdk_debug/libpmemobj.so.* $LIB_DIR/pmdk_dbg/
691 $LIB_DIR/libpmemobj.so
692 $LIB_DIR/pkgconfig/libpmemobj.pc
693 $INC_DIR/libpmemobj.h
694 $INC_DIR/libpmemobj/*.h
695 $MAN7_DIR/libpmemobj.7
696 $MAN3_DIR/pmemobj_*.3
697 $MAN3_DIR/pobj_*.3
698 $MAN3_DIR/oid_*.3
699 $MAN3_DIR/toid*.3
700 $MAN3_DIR/direct_*.3
701 $MAN3_DIR/d_r*.3
702 $MAN3_DIR/tx_*.3
703 EOF
704
705 cat << EOF > debian/libpmemobj-dev.lintian-overrides
706 $ITP_BUG_EXCUSE
707 new-package-should-close-itp-bug
708 # The following warnings are triggered by a bug in debhelper:
709 # https://bugs.debian.org/204975
710 postinst-has-useless-call-to-ldconfig
711 postrm-has-useless-call-to-ldconfig
712 # We do not want to compile with -O2 for debug version
713 hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
714 # pmdk provides second set of libraries for debugging.
715 # These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
716 # Related issue: https://github.com/pmem/issues/issues/841
717 libpmemobj-dev: package-has-unnecessary-activation-of-ldconfig-trigger
718 EOF
719
720 cat << EOF > debian/libpmempool.install
721 $LIB_DIR/libpmempool.so.*
722 EOF
723
724 cat << EOF > debian/libpmempool.lintian-overrides
725 $ITP_BUG_EXCUSE
726 new-package-should-close-itp-bug
727 libpmempool: package-name-doesnt-match-sonames
728 EOF
729
730 cat << EOF > debian/libpmempool-dev.install
731 $LIB_DIR/pmdk_debug/libpmempool.a $LIB_DIR/pmdk_dbg/
732 $LIB_DIR/pmdk_debug/libpmempool.so $LIB_DIR/pmdk_dbg/
733 $LIB_DIR/pmdk_debug/libpmempool.so.* $LIB_DIR/pmdk_dbg/
734 $LIB_DIR/libpmempool.so
735 $LIB_DIR/pkgconfig/libpmempool.pc
736 $INC_DIR/libpmempool.h
737 $MAN7_DIR/libpmempool.7
738 $MAN3_DIR/pmempool_*.3
739 EOF
740
741 cat << EOF > debian/libpmempool-dev.lintian-overrides
742 $ITP_BUG_EXCUSE
743 new-package-should-close-itp-bug
744 # The following warnings are triggered by a bug in debhelper:
745 # https://bugs.debian.org/204975
746 postinst-has-useless-call-to-ldconfig
747 postrm-has-useless-call-to-ldconfig
748 # We do not want to compile with -O2 for debug version
749 hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
750 # pmdk provides second set of libraries for debugging.
751 # These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
752 # Related issue: https://github.com/pmem/issues/issues/841
753 libpmempool-dev: package-has-unnecessary-activation-of-ldconfig-trigger
754 EOF
755
756 cat << EOF > debian/$PACKAGE_NAME-dbg.lintian-overrides
757 $ITP_BUG_EXCUSE
758 new-package-should-close-itp-bug
759 EOF
760
761 cat << EOF > debian/pmempool.install
762 usr/bin/pmempool
763 $MAN1_DIR/pmempool.1
764 $MAN1_DIR/pmempool-*.1
765 usr/share/bash-completion/completions/pmempool
766 EOF
767
768 cat << EOF > debian/pmempool.lintian-overrides
769 $ITP_BUG_EXCUSE
770 new-package-should-close-itp-bug
771 EOF
772
773 cat << EOF > debian/pmreorder.install
774 usr/bin/pmreorder
775 usr/share/pmreorder/*.py
776 $MAN1_DIR/pmreorder.1
777 EOF
778
779 cat << EOF > debian/pmreorder.lintian-overrides
780 $ITP_BUG_EXCUSE
781 new-package-should-close-itp-bug
782 EOF
783
784 # librpmem & rpmemd
785 if [ "${BUILD_RPMEM}" = "y" -a "${RPMEM_DPKG}" = "y" ]
786 then
787 append_rpmem_control;
788 rpmem_install_triggers_overrides;
789 fi
790
791 # libpmem2
792 if [ "${PMEM2_INSTALL}" == "y" ]
793 then
794 append_libpmem2_control;
795 libpmem2_install_triggers_overrides;
796 fi
797
798 # daxio
799 if [ "${NDCTL_ENABLE}" != "n" ]
800 then
801 append_daxio_control;
802 daxio_install_triggers_overrides;
803 fi
804
805 # Convert ChangeLog to debian format
806 CHANGELOG_TMP=changelog.tmp
807 dch --create --empty --package $PACKAGE_NAME -v $PACKAGE_VERSION-$PACKAGE_RELEASE -M -c $CHANGELOG_TMP
808 touch debian/changelog
809 head -n1 $CHANGELOG_TMP >> debian/changelog
810 echo "" >> debian/changelog
811 convert_changelog ChangeLog >> debian/changelog
812 echo "" >> debian/changelog
813 tail -n1 $CHANGELOG_TMP >> debian/changelog
814 rm $CHANGELOG_TMP
815
816 # This is our first release but we do
817 debuild --preserve-envvar=EXTRA_CFLAGS_RELEASE \
818 --preserve-envvar=EXTRA_CFLAGS_DEBUG \
819 --preserve-envvar=EXTRA_CFLAGS \
820 --preserve-envvar=EXTRA_CXXFLAGS \
821 --preserve-envvar=EXTRA_LDFLAGS \
822 --preserve-envvar=NDCTL_ENABLE \
823 -us -uc -b
824
825 cd $OLD_DIR
826
827 find $WORKING_DIR -name "*.deb"\
828 -or -name "*.dsc"\
829 -or -name "*.changes"\
830 -or -name "*.orig.tar.gz"\
831 -or -name "*.debian.tar.gz" | while read FILE
832 do
833 mv -v $FILE $OUT_DIR/
834 done
835
836 exit 0