698N/AThis is a case study of migrating one library (libtecla) from ON to Userland.
698N/AI (JBeck) was able to figure out a fair amount on my own, but had to rely on
698N/ANorm for a great deal more, so thought it would be worthwhile to document what
698N/Awe went through, to save others time in the future.
698N/A
698N/A* Initially just four files were needed:
698N/A * Makefile, which in this case I copied from libsndfile as it seemed to be
698N/A the closest match.
698N/A * The license: ON's usr/src/lib/libtecla/THIRDPARTYLICENSE copied verbatim
698N/A to Userland path components/libtecla/libtecla.license .
698N/A * The lint library: ON's usr/src/lib/libtecla/common/llib-ltecla copied to
698N/A Userland path components/libtecla/llib-ltecla .
698N/A * The package manifest: ON's usr/src/pkg/manifests/library-libtecla.mf,
698N/A with usr/man/pkg/library-libtecla.man.p5m included, copied to Userland
698N/A path libtecla.p5m .
698N/A
698N/A* Coming from ON, there were already "Solarified" man pages available, so we
698N/A specified the "--without-man-pages" configure option in the Makefile, and
698N/A copied all the man pages from ON's usr/man/man/... to the files/ directory
698N/A and added this Makefile line, which causes pkgdepend/pkgsend to add the
698N/A appended directories to their search paths when looking for content:
698N/A
698N/A PKG_PROTO_DIRS += $(COMPONENT_DIR)/files
698N/A
698N/A* Because one of the man pages (enhance.1) had been translated, and there
698N/A were thus multiple files with the same name, we tweaked the names of the
698N/A translated files, and used the tweaked names in the package manifest. We
698N/A also added the following to get needed "action.hash" and "mangler.bypass"
698N/A attributes: the former causes pkgmogrify to take the last part of the file
698N/A action's path attribute (basename) and set the 'hash' value to the basename
698N/A so that it can be located at the top level of one of the search directories,
698N/A while the latter causes the userland-mangler to ignore the file, since as
698N/A mentioned above these man pages come pre-Solarified, whereas the default
698N/A for Userland is running a file mangler on some of the files to be packaged.
698N/A This file mangler adds ATTRIBUTES and NOTES sections to man pages with
698N/A 'stability', 'availability', project and source urls. It also strips the
698N/A CDDL from files right now. More functionality may be added over time.
698N/A
698N/A <transform file path=usr/share/man/man.+/(.+)$ -> set action.hash %<\1> >
698N/A <transform file path=usr/share/man/.+$ -> add mangler.bypass true >
698N/A
698N/A* On the package manifest fmri action, ON's macros:
698N/A
698N/A $(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
698N/A
698N/A needed to be changed to comparable Userland macros:
698N/A
698N/A $(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
698N/A
698N/A* These ON attributes needed to be removed:
698N/A
698N/A set name=org.opensolaris.version-unlockable value=true
698N/A set name=variant.arch value=$(ARCH)
698N/A
698N/A* The info.upstream-url attribute value needed to be changed from the hard-
698N/A coded URL in ON to $(COMPONENT_PROJECT_URL) in Userland.
698N/A
698N/A* These needed to be added (note your actual year and ARC case number should
698N/A be used instead of "YYYY" and "CCC" respectively):
698N/A
698N/A set name=org.opensolaris.arc-caseid value=PSARC/YYYY/CCC
698N/A set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
698N/A
698N/A* The $(ARCH64) macro used by ON needed to be changed to $(MACH64).
698N/A
698N/A* ON's license action:
698N/A
698N/A license usr/src/lib/libtecla/THIRDPARTYLICENSE \
698N/A license=usr/src/lib/libtecla/THIRDPARTYLICENSE
698N/A
698N/A needed to be changed to:
698N/A
698N/A license libtecla.license license="MIT-like"
698N/A
698N/A Note that "MIT-like" applies to this library; others will have different
698N/A values.
698N/A
698N/A* Apparently this is unusual, but libtecla's Makefile structure did not have
698N/A support for $(DESTDIR), so we had to patch Makefile.in to add it.
698N/A
698N/A* Again this is apparently unusual, but libtecla's Makefile structure had
698N/A LD_RUN_PATH include the working directory, which resulted in build paths
698N/A being embedded in the binaries. So we had to patch Makefile.rules to
698N/A remove that.
698N/A
698N/A* ldd was showing libthread despite it not being explicitly listed; this
698N/A turned out to be because Userland sets -mt by default, so we had to unset
698N/A studio_MT in the Makefile.