2015年9月16日 星期三

包rpm的骯髒事

最近在自己包rpm包,CentOS與Fedora的openssl rpm包因為某些版權問題把bitcoin所需要的橢圓曲線拿掉了,因此必須自己compile一個openssl給bitcoin使用。

無奈的是要讓其他人自己在configure下參數來找到我們自己編的openssl實在是太麻煩了,只好想辦法讓bitcoin在configure與compile時不下任何參數也能避開系統的openssl,而是用到我們包的版本。

我們的server清一色都是CentOS 7,因此團隊裡的大大們覺得乾脆我們自己包一個好了,然後就是由我來負責Orz。

首先,rpm specfile雖然簡單明瞭,但在很容易不小心把沒列在file section中的file install到BUILD_ROOT,這樣會造成錯誤。install section是在整個包的過程最後一步,openssl build一次又需要5~10分鐘,各種低級的error就浪費了我很多時間。

最後終於包好了,要怎麼讓bitcoin找到我們自己compile的libssl.so與libcrypto.so呢?
(以下方法滿髒的但小弟是新手又有deadline只好出此下策)
  1. /etc/profile中加入export PKG_CONFIG_PATH=/usr/local/openssl/lib ,讓每個使用者登入時都會設好PKG_CONFIG_PATH,這樣在configure時autoconf會找到我們要的SSL_CFLAGS和SSL_LD_FLAGS並產生好Makefile。
  2. 這時去make還是會發現我們仍是抓到系統的.so,真的很奇怪。打開verbose模式 make V=1 才發現需要用到openssl的某幾條gcc指令竟然還有幾個-L/usr/lib之類的linker path參數放在我們的-L/usr/local/openssl/lib之前!
  3. 最後我們只好在/etc/profile中又加上了export CXX="c++ -L/usr/local/openssl/lib" 這樣就保證了我們的路徑比系統的還優先找到XDD
此時,我們已經能抓到正確的openssl來編了。然而一執行bitcoind …
 ./bitcoind: /usr/lib/libcrypto.so: no version information available ...
去google才發現若執行時ld.so發現抓到的.so版本比編譯時的.so還舊,就會報這個error。

此時才想到忘記把.so的path加入ld.so.cache。在/etc/ld.so.conf.d/下創一個檔案並把路徑加入後,再執行
 $ ldconfig
讓路徑load至cache中就完成了!
最後,感謝強者lantw44的指導阿!

8 則留言:

  1. 現在是在 2017,回頭看還是一樣屌!

    回覆刪除
  2. 1xbet | 1xbet | Bet with a Bonus - RMC | Riders Casino
    1XBet allows you to bet on any microtouch solo titanium favourite horse races or novcasino any other sporting 토토사이트 event. ✓ Get up to 1xbet korean £300 + 200 Free Spins No Deposit

    回覆刪除
  3. Macau's casinos have been losing tens of millions of dollars month-to-month due to of} coronavirus restrictions because the particular administrative region follows China's 'dynamic zero COVID' policy, which goals to curb all outbreaks. Sign Up NowGet this delivered to your inbox, and more information about our services 리턴벳 and products. Was down 1.18% in its final hour of commerce whereas gaming shares rebounded following news of an e-visa system for mainland Chinese guests to Macao. It supplies a much-needed boost to Ocado at a time when grocery sales are slowing, and its shares jumped 33% to 632p on the news. There have been no stories of harm or accidents from areas the place the alerts were issued. Bullet practice services in those areas were quickly suspended following the missile alert earlier than resuming shortly.

    回覆刪除
  4. At the top of your display, you’ll discover an orange “Play Now” button. Click on it, then fill out any requested private info. To get started, fiat bettors should deposit a minimum of|no less 파라오카지노 than} $25 by way of bank card, $100 by way of P2P switch, $300 by way of cash order, or $1,000 by way of bank wire.

    回覆刪除
  5. In the Results section, we begin with an analysis of wager distribution and log-ratios between successive wagers, 카지노사이트 which helps us to grasp the gamblers’ wagering strategy. We then give attention to} an analysis of threat perspective by learning the distribution of the odds gamers choose to wager with. We conclude by extending our dialogue to the analysis of internet incomes of gamblers viewed as random walks. Detailed details about the video games and datasets mentioned on this paper can be found in the Methods section. Scalability means thousands of concurrent gamers can enjoy the live video games on all gadgets.

    回覆刪除
  6. This is why we added free slots on-line casinos that settle for trusted and safe banking choices. In addition to free slots video games, the casino sites on our listing allow you to play video games like video poker, blackjack, roulette, and stay vendor video games — each at no cost and for actual money. If you’re chasing massive winnings – progressive jackpots slots are your greatest choose. If you need old-school slot machines usually out there at brick-and-mortar casinos, three-reelers are your appropriate option|best option}. Yes, numerous gamers have gained six-figure prizes enjoying in} on-line slots. However, you need to|you should|you have to} hold your expectations actual – winning so much money by enjoying 토토사이트 in} slots on-line is fairly unlikely; play for fun as an alternative, and of course – dreaming massive is always good.

    回覆刪除