Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Monthly Archives: September 2008

[Enterprise Linux 5] dist tag in rpm –showrc

In my previous post, I mentioned that the dist tag problem can be fixed in ~/.rpmnacros.

Nevertheless, I find the source of the problem: /etc/rpm/macros.rpmforge, which wrongly states the dist as el5.

To fix that, replace the line in /etc/rpm/macros.rpmforge:

%dist el5

with

%dist .el5

.

Advertisements

About “Avoiding Packing junk in CPack/CMake”

One reader of mine suggested that I can posted my finding to Fedora Wiki, but I don’t know how. Would you kind enough to tell me where do I start, thanks.

Nevertheless, my previous post does not show the whole method of junk-filtering in CMake/CPack. Following example demonstrates how to use CPack in CMake:

### Package configuration
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "<project name>")
SET(CPACK_PACKAGE_VENDOR "<vendor name>")
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE
    ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
SET(CPACK_RESOURCE_FILE_LICENSE
    ${CMAKE_CURRENT_SOURCE_DIR}/COPYING.LESSER)
SET(CPACK_PACKAGE_VERSION_MAJOR <PROJECT_VER_MAJOR>)
SET(CPACK_PACKAGE_VERSION_MINOR <PROJECT_VER_MINOR>)
SET(CPACK_PACKAGE_VERSION_PATCH <PROJECT_VER_PATCH>)
SET(COMMON_IGNORE_FILES "/CMakeFiles/" "/Testing/" "/.svn/" "/CVS/" "_CPack_Packages/" 
    ".cmake$" "~" ".swp" ".log" ".gz" ".directory$" "CMakeCache.txt")
SET(PRJ_COMMON_IGNORE_FILES ${COMMON_IGNORE_FILES} <PROJECT_SPECIFIC_IGNORE_FILES_PATTERN> )

SET(CPACK_SOURCE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} 
<FILES_PATTERN_THAT_YOU_DONT_WANT_TO_PUT_IN_SOURCE_TARBALL>)
SET(CPACK_PACKAGE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} <FILES_PATTERN_THAT_YOU_DONT_WANT_TO_PUT_IN_BINARY_TARBALL> )
SET(CPACK_SOURCE_GENERATOR "TGZ")

INCLUDE(CPack)

Note that COMMON_IGNORE_FILES,PRJ_COMMON_IGNORE_FILES are my own variable, you can choose the name you like.

After executed cmake <project dir> you can see the make targets by typing make help

......
... package
... package_source
......

Use make package for binary package, and
make package_source for source tarball.

ucs4_sort

sort in Unix system is a wonderful tool, however, it does not handles utf8 files properly, because sort tends to treat them as ASCII strings. There is some solution like msort, but I never get it work.

I therefore write a small program, ucs4_sort, that sorts lines of text files by their UCS-4 encoding. This program DOES NOT implement the Unicode collation algorithm, so do not use the on locale sensitive data.

Please go here for further details.

Opera Chinese/Japanese/Korean input with iBus

iBus is a next generation input method framework using D-Bus.
The interface is very clean, and it does not have nasty SCIM C++ ABI transition problem.

Opera does not support it out of box. However, since it supports XIM by setting the export QT_IM_MODULE environment variable, inserting:

export QT_IM_MODULE=XIM

in /usr/bin/opera makes iBus works with opera.