Skip to content
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

[master][dunfell] openct: cleanup and allow building as native package #299

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions meta-oe/recipes-support/openct/openct_0.6.20.bb
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@ EXTRA_OECONF=" \
--enable-pcsc \
--enable-doc \
--enable-api-doc \
--with-udev=${nonarch_base_libdir}/udev \
--with-udev=${nonarch_libdir}/udev \
--with-bundle=${libdir}/pcsc/drivers \
"

inherit autotools pkgconfig

FILES_${PN} += " \
${libdir}/ctapi \
${nonarch_base_libdir}/udev \
${nonarch_libdir}/udev \
${libdir}/openct-ifd.so \
${libdir}/pcsc \
/run/openct/status \
"

FILES_${PN}-dbg += " \
Expand All @@ -56,33 +55,29 @@ FILES_${PN}-dbg += " \

INSANE_SKIP_${PN} += "dev-deps"

do_install[cleandirs] += "${D}"

do_install () {
rm -rf ${D}
install -d ${D}/etc
install -dm 755 ${D}${nonarch_base_libdir}/udev
install -d ${D}${sysconfdir}
# fix up hardcoded paths
sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \
${WORKDIR}/openct.service ${WORKDIR}/openct.init

oe_runmake install DESTDIR=${D}
install -dm 755 ${D}${libdir}/ctapi/
mv ${D}${libdir}/libopenctapi.so ${D}${libdir}/ctapi/
install -Dpm 644 etc/openct.udev ${D}/etc/udev/rules.d/60-openct.rules
install -pm 644 etc/openct.conf ${D}/etc/openct.conf
install -Dpm 644 etc/openct.udev ${D}${nonarch_libdir}/udev/rules.d/60-openct.rules
install -pm 644 etc/openct.conf ${D}${sysconfdir}/openct.conf

install -Dpm 755 ${WORKDIR}/openct.init ${D}/etc/init.d/openct
install -Dpm 644 ${WORKDIR}/openct.sysconfig ${D}/etc/sysconfig/openct
install -Dpm 755 ${WORKDIR}/openct.init ${D}${sysconfdir}/init.d/openct
install -Dpm 644 ${WORKDIR}/openct.sysconfig ${D}${sysconfdir}/sysconfig/openct

install -d ${D}/${systemd_unitdir}/system
install -m 644 ${WORKDIR}/openct.service ${D}/${systemd_unitdir}/system
install -d ${D}${systemd_unitdir}/system
install -m 644 ${WORKDIR}/openct.service ${D}${systemd_unitdir}/system

so=$(find ${D} -name \*.so | sed "s|^${D}||")
sed -i -e 's|\\(LIBPATH\\s*\\).*|\\1$so|' etc/reader.conf
install -Dpm 644 etc/reader.conf ${D}/etc/reader.conf.d/openct.conf

install -dm 755 ${D}${localstatedir}/run/openct
touch ${D}${localstatedir}/run/openct/status
chmod 644 ${D}${localstatedir}/run/openct/status

rm -r ${D}/${localstatedir}/run
install -Dpm 644 etc/reader.conf ${D}${sysconfdir}/reader.conf.d/openct.conf
}

BBCLASSEXTEND="native"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually, a space on both sides of = is norm.